This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28301] New: [4.0/4.1/4.2 regression] ICE with broken specialization
- 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: 7 Jul 2006 14:25:46 -0000
- Subject: [Bug c++/28301] New: [4.0/4.1/4.2 regression] ICE with broken specialization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid code snippet triggers an ICE since GCC 3.4.0:
===========================================
template<typename> struct A
{
template<int> void foo() // missing ;
};
template<> struct A<void>
{
template<int> void foo();
};
void bar()
{
A<void> a;
a.foo<0>();
}
===========================================
bug.cc:4: error: expected initializer before '}' token
bug.cc:6: error: explicit specialization in non-namespace scope 'struct A<
<template-parameter-1-1> >'
bug.cc:6: error: enclosing class templates are not explicitly specialized
bug.cc:6: error: template parameters not used in partial specialization:
bug.cc:6: error: '<template-parameter-1-1>'
bug.cc:15: error: expected `}' at end of input
bug.cc: In member function 'void A< <template-parameter-1-1> >::bar()':
bug.cc:14: internal compiler error: in retrieve_specialization, at cp/pt.c:819
Please submit a full bug report, [etc.]
--
Summary: [4.0/4.1/4.2 regression] ICE with broken specialization
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, 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=28301