This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9338: ICE in peculiar templated constructors
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, martin at xemacs dot org, nobody at gcc dot gnu dot org
- Date: 16 Jan 2003 15:12:09 -0000
- Subject: Re: c++/9338: ICE in peculiar templated constructors
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, martin at xemacs dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Synopsis: ICE in peculiar templated constructors
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Jan 16 07:12:02 2003
State-Changed-Why:
Confirmed. A smaller testcase is this:
-------------------------
struct Bool {
template <bool> struct CC { typedef int Int; };
template <typename> struct S1 { enum { value = true }; };
template <typename> struct S2 { enum { value = false }; };
template <typename T>
Bool (T x, typename CC<S1<T>::value>::Int = 0);
template <typename T>
Bool (T x, typename CC<!S2<T>::value>::Int = 0);
};
int main () {
Bool b (1);
}
--------------------------------------
Note that the second type of the two overloads of the
constructor resolve to the same type, int.
This code crashes gcc since at least 2.95:
g/a> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:15: 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.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9338