This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/39478] New: please improve recursive template instantiation diagnostics
- From: "d dot frey at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Mar 2009 07:27:38 -0000
- Subject: [Bug c++/39478] New: please improve recursive template instantiation diagnostics
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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:
frey@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;
frey@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> >'
frey@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