[forwarded from http://bugs.debian.org/353366]
gcc version 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)
[EMAIL PROTECTED]:/tmp% cat bla.cc
template<bool> struct cond;
template<int> struct S {
void f(int i) {
cond<__builtin_constant_p(i)>();
}
};
S<1> s;
[EMAIL PROTECTED]:/tmp% g++ -c bla.cc
bla.cc: In member function 'void S<<anonymous> >::f(int)':
bla.cc:5: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
[EMAIL PROTECTED]:/tmp% g++-3.4 -c bla.cc
bla.cc: In member function `void S<<anonymous> >::f(int)':
bla.cc:5: error: `int __builtin_constant_p(...)' cannot appear in a
constant-expression
bla.cc:5: error: `i' cannot appear in a constant-expression
bla.cc:5: error: a function call cannot appear in a constant-expression
bla.cc:5: error: template argument 1 is invalid
--
Summary: ICE with __builtin_constant_p in template argument
Product: gcc
Version: 4.0.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian-gcc at lists dot debian dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26559