This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9452: ICE with templates (no better explanation possible)
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 27 Jan 2003 16:01:01 -0000
- Subject: c++/9452: ICE with templates (no better explanation possible)
- Reply-to: bangerth at ticam dot utexas dot edu
>Number: 9452
>Category: c++
>Synopsis: ICE with templates (no better explanation possible)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 27 16:06:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
OK, this is #1 of 7 (this weekends batch of ICE findings :-( )
This crashes every gcc since at least 2.95 with a SegFault:
----------------------------------
template <int> struct Len { static const int val = 1; };
template <int> struct X {};
template <typename T> void foo(X<1>) {};
template <typename T, int N>
X<Len<N>::val-1>
foo(X<N>) {
foo<int> (X<N>());
};
int main () {
foo<int>(X<1>());
};
--------------------------------
g/a> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c bug32-1.cc
bug32-1.cc: In function `int main()':
bug32-1.cc:13: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: