This is the mail archive of the
gcc-prs@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: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 9 Jul 2002 00:06:02 -0000
- Subject: Re: c++/5931: ICE when using template class that is child if another template class
- Reply-to: "Giovanni Bajo" <giovannibajo at libero dot it>
The following reply was made to PR c++/5931; it has been noted by GNATS.
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
<gcc-prs@gcc.gnu.org>,
<f_ker@yahoo.co.uk>,
<gcc-bugs@gcc.gnu.org>,
<nobody@gcc.gnu.org>
Cc:
Subject: Re: c++/5931: ICE when using template class that is child if another template class
Date: Tue, 9 Jul 2002 01:56:47 +0200
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.