re PR c++/47207 ([C++0x] ICE: in decl_constant_var_p, at cp/decl2.c:3563 on invalid...
authorJason Merrill <jason@redhat.com>
Mon, 21 Feb 2011 15:35:44 +0000 (10:35 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 21 Feb 2011 15:35:44 +0000 (10:35 -0500)
commit9931a2bf8c807326be1596dc0698872e32823e17
treeb4c3ba53f68b6d7631c54b3b504bd02dcf9ce100
parente292d00367ce0a736a7c1e1433e7920eeb0673cf
re PR c++/47207 ([C++0x] ICE: in decl_constant_var_p, at cp/decl2.c:3563 on invalid code)

PR c++/47207
* decl2.c (decl_constant_var_p): A constexpr var needs an
initializer to be constant.
* semantics.c (cxx_eval_constant_expression): Complain about
constexpr var used in its own initializer.
* call.c (set_up_extended_ref_temp): Set
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P too.

From-SVN: r170365
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/decl2.c
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-diag2.C [new file with mode: 0644]