When compiling: struct S { typedef void *P; }; namespace M { typedef void *P; };
namespace N { class S; struct N { template <typename T> void foo (typename T::P); }; struct R { N& n; template <class U, class T> inline void bar (U p); void baz (M::P); }; template <class U, class T> inline void R::bar (U p) { n.foo <typename T> (p); delete this; } void R::baz (M::P p) { bar <M::P, S>(p); } } I get: 141300.ii: In member function `void N::R::bar(U) [with U = void*, T = N::S]': 141300.ii:36: instantiated from here 141300.ii:30: internal compiler error: tree check: expected tree_vec, have error_mark in get_innermost_template_args, at cp/pt.c:575 with checking enabled and usually segfault with checking disabled, in both GCC 3.4.x and 4.0.0. explicit_targs passed down from build_new_method_call is error_mark. -- Summary: ICE (on invalid) in get_innermost_template_args Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jakub at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18757