Bug 35097 - [4.3 regression] ICE with attribute and template specialization
Summary: [4.3 regression] ICE with attribute and template specialization
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.3.0
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2008-02-06 07:28 UTC by Volker Reichelt
Modified: 2008-02-12 06:42 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.2
Known to fail:
Last reconfirmed: 2008-02-12 04:32:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-02-06 07:28:25 UTC
The following valid code snippet triggers an ICE on mainline:

===========================================================
template<int> struct A;

template<> struct A<0>
{
  typedef int X __attribute((aligned(4)));
};

template<typename T> void foo(const A<0>::X&, T);

void bar()
{
  foo(A<0>::X(), 0);
}
===========================================================

bug.cc: In function 'void bar()':
bug.cc:12: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Comment 1 Richard Biener 2008-02-06 12:23:46 UTC
Confirmed.
Comment 2 Jason Merrill 2008-02-12 06:35:43 UTC
Subject: Bug 35097

Author: jason
Date: Tue Feb 12 06:34:59 2008
New Revision: 132253

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132253
Log:
        PR c++/35097
        * pt.c (tsubst): Don't look up a template typedef in an explicit
        specialization.

Added:
    trunk/gcc/testsuite/g++.dg/ext/attrib31.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c

Comment 3 Jason Merrill 2008-02-12 06:42:42 UTC
Fixed.