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++/46871] [C++0x] ICE: in cxx_eval_constant_expression, at cp/semantics.c:6686 on invalid code (+rejects valid)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46871

Andreas Beckmann <gcc at abeckmann dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc at abeckmann dot de

--- Comment #1 from Andreas Beckmann <gcc at abeckmann dot de> 2011-01-11 12:49:41 UTC ---
The following testcase (invalid code) results in the same ICE, but
unfortunately ICEs are difficult to compare, so this may be an independent
issue.

===== 8< =====
template < , , >
struct S ;
template < typename >
f ( ) {
        const bool b = && ;
        S < , b ,
===== >8 =====

$ g++-trunk -m64 -std=c++0x -pthread -O3 -c -o a.o PR46871-2.C
PR46871-2.C:1:12: error: expected identifier before â,â token
PR46871-2.C:1:14: error: expected identifier before â,â token
PR46871-2.C:1:16: error: expected identifier before â>â token
PR46871-2.C:4:5: error: ISO C++ forbids declaration of âfâ with no type
[-fpermissive]
PR46871-2.C: In function âint f()â:
PR46871-2.C:5:20: error: expected identifier before â;â token
PR46871-2.C:6:10: error: template argument 1 is invalid
PR46871-2.C:6:10: error: â(int)bâ is not a valid template argument for type
âintâ because it is a non-constant expression
PR46871-2.C:6:10: error: the value of âbâ is not usable in a constant
expression
PR46871-2.C:6:10: internal compiler error: in cxx_eval_constant_expression, at
cp/semantics.c:6688
Please submit a full bug report,

gcc version 4.6.0 20110107 (experimental) (GCC)


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