When a template is instantiated and the instantiation requires access to the instantiated template, the error message is not as helpful as it could/should be. Consider:
f...@viasko:~/work/test/recursive_instantiation$ cat t.cc template< typename T > struct foo { typename T::type dummy(); }; template< typename T > struct bar { typedef void type; foo< bar > p; }; foo< bar< int > > x; f...@viasko:~/work/test/recursive_instantiation$ g++ t.cc t.cc: In instantiation of 'bar<int>': t.cc:4: instantiated from 'foo<bar<int> >' t.cc:14: instantiated from here t.cc:11: error: 'bar<T>::p' has incomplete type t.cc:3: error: declaration of 'struct foo<bar<int> >' f...@viasko:~/work/test/recursive_instantiation$ The problem is t.cc:11: error: 'bar<T>::p' has incomplete type - at that point I hoped for a more helpful message. -- Summary: please improve recursive template instantiation diagnostics Product: gcc Version: 4.3.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: d dot frey at gmx dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39478