This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34487] New: [4.1/4.2/4.3 regression] ICE using class instead of typename
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2007 22:48:56 -0000
- Subject: [Bug c++/34487] New: [4.1/4.2/4.3 regression] ICE using class instead of typename
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid testcase triggers an ICE since GCC 4.1.2:
================================================
template<typename> struct A
{
template<int> struct B { typedef A X; };
};
template<typename T> struct C
{
class A<T>::template B<0>::X x;
};
C<int> c;
================================================
bug.cc: In instantiation of 'A<int>::B<0>':
bug.cc:8: instantiated from 'C<int>'
bug.cc:11: instantiated from here
bug.cc:3: internal compiler error: in instantiate_class_template, at
cp/pt.c:6765
Please submit a full bug report, [etc.]
The code was accepted before.
If I make B a non-template the situation is reversed, i.e. the code is
wrongly accepted since GCC 4.1.2 while it ICE'd before:
================================================
template<typename> struct A
{
struct B { typedef A X; };
};
template<typename T> struct C
{
class A<T>::B::X x;
};
C<int> c;
================================================
The problem is probably related to PR32029 (which ICEs since GCC 3.4.0,
though).
--
Summary: [4.1/4.2/4.3 regression] ICE using class instead of
typename
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, accepts-invalid, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34487