This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/5931: ICE when using template class that is child if another template class
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: <gcc-gnats at gcc dot gnu dot org>,<gcc-prs at gcc dot gnu dot org>,<f_ker at yahoo dot co dot uk>,<gcc-bugs at gcc dot gnu dot org>,<nobody at gcc dot gnu dot org>
- Date: Tue, 9 Jul 2002 01:56:47 +0200
- Subject: Re: c++/5931: ICE when using template class that is child if another template class
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=5931
Notice that the code is not legal C++. The snippet reported by Reichelt is:
------------------------snip here------------------------
template <typename T, typename U> struct A
{
template <typename V> class SubA {};
};
template <typename T> struct B : public A<T,int>::SubA<int> {};
B<int> b;
------------------------snip here------------------------
which is not legal C++, because it's accessing a nested template without the
explicit template keyword. The correct version:
------------------------snip here------------------------
template <typename T> struct B : public A<T,int>::template SubA<int> {};
------------------------snip here------------------------
which correctly compiles on my GCC 3.1. So the PR type should be changed to
ice-on-illegal-code. This should also solve the reporter's compilation
problems.
Giovanni Bajo
P.S: I'm not subscibed to any GCC list, so please include my adress in CC
list if needed.