PR c++/81073 - constexpr and static var in statement-expression.
authorJason Merrill <jason@redhat.com>
Mon, 19 Jun 2017 18:20:10 +0000 (14:20 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 19 Jun 2017 18:20:10 +0000 (14:20 -0400)
commit4b691b139f04d13a00a959020ff976fdab60b9b1
tree49dff5d7a10ccfed86633f18d38020cbb01cabaa
parentc9f8853f9e74816ccb68a5a549f1f61295ce07ed
PR c++/81073 - constexpr and static var in statement-expression.

* typeck2.c (store_init_value): Always call
require_potential_constant_expression.
* pt.c (convert_nontype_argument): Likewise.
* constexpr.c (potential_constant_expression_1): Adjust message.
Use decl_maybe_constant_var_p instead of decl_constant_var_p.
* decl2.c (decl_maybe_constant_var_p): Consider initializer.

From-SVN: r249382
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/decl2.c
gcc/cp/pt.c
gcc/cp/typeck2.c
gcc/testsuite/g++.dg/cpp0x/constexpr-diag1.C
gcc/testsuite/g++.dg/cpp0x/constexpr-trivial2.C
gcc/testsuite/g++.dg/ext/stmtexpr19.C [new file with mode: 0644]