This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26559] New: ICE with __builtin_constant_p in template argument


[forwarded from http://bugs.debian.org/353366]

gcc version 4.0.3 20060212 (prerelease) (Debian 4.0.2-9)

falk@juist:/tmp% cat bla.cc
template<bool> struct cond;

template<int> struct S {
    void f(int i) {
        cond<__builtin_constant_p(i)>();
    }
};

S<1> s;

falk@juist:/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.

falk@juist:/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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]