The following (probably valid) code snippet triggers an ICE since GCC 3.1:
======================================================================
template<typename> struct A {};
template<int> struct B;
template<int N> struct C : A<typename B<N>::X __attribute__((unused))> {};
======================================================================
bug.cc:5: internal compiler error: in layout_type, at stor-layout.c:1851
Please submit a full bug report, [etc.]
A similar code snippet causes a segfault:
======================================================================
template<typename> struct A {};
template<int> struct B;
template<> struct A<B<0> __attribute__((unused))> {};
======================================================================
--
Summary: [4.0/4.1/4.2 regression] Trouble with __attribute__ in
template parameter
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, 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=28560