PR c++/83273 - constexpr if allows non-constant condition
commit27db1f50e3571b928081b1c54169c8ec0cd3449d
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Dec 2017 22:52:07 +0000 (4 22:52 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 4 Dec 2017 22:52:07 +0000 (4 22:52 +0000)
tree5044a11213ef3456a0847e4bfbb8801ef4d9b571
parent6dfed74aba781be8b1cfc355267659cd5d34611a
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255390 138bc75d-0d04-0410-961f-82ee72b054a4
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]