PR c++/83273 - constexpr if allows non-constant condition
authorJason Merrill <jason@redhat.com>
Mon, 4 Dec 2017 22:52:07 +0000 (17:52 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 4 Dec 2017 22:52:07 +0000 (17:52 -0500)
commit899ac3b80040d7879082b5df11675cea88a43756
tree5044a11213ef3456a0847e4bfbb8801ef4d9b571
parentf3abed16a01153c7a72d5795076c392cdb19c9dd
PR c++/83273 - constexpr if allows non-constant condition

* semantics.c (finish_if_stmt_cond): Use require_constant_expression
rather than is_constant_expression.
* constexpr.c (potential_constant_expression_1) [LAMBDA_EXPR]: Allow
in C++17.

From-SVN: r255390
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/semantics.c
gcc/testsuite/g++.dg/cpp1z/constexpr-if12.C
gcc/testsuite/g++.dg/cpp1z/constexpr-if13.C [new file with mode: 0644]