------- Comment #3 from d dot frey at gmx dot de  2009-03-16 23:49 -------
One more thought on the diagnostics: There are two cases: Incomplete types
(like in the initial example in the description of this PR) and recursive
template instantiations (see attachment). I think the latter produces a
diagnostic which suggests it is the former. This problem not only affects
C++0x, it also happens for "normal" C++:

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$ 

g++ is Ubuntu's GCC 4.3.2. The error message says bar<T>::p is incomplete, but
there is no hint why this is the case. Would it be possible to generally
improve this type of diagnostic? Should I open yet another PR or is that not
possible/worth it/...?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39475

Reply via email to