re PR c++/84854 (ICE: unexpected expression in cxx_eval_constant_expression, at cp...
authorMarek Polacek <polacek@redhat.com>
Thu, 22 Mar 2018 08:08:07 +0000 (08:08 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Thu, 22 Mar 2018 08:08:07 +0000 (08:08 +0000)
commit08ad2797c60b66f8a6ca54652cdead0aa6ea721f
treef9899378cfb63c1e7528b102e9bd49112f356ce1
parent2170d4b6ddca526b53e87215dbf6fab5973000c7
re PR c++/84854 (ICE: unexpected expression in cxx_eval_constant_expression, at cp/constexpr.c:4774)

PR c++/84854
* semantics.c (finish_if_stmt_cond): Check if the type of the condition
is boolean.

* g++.dg/cpp1z/constexpr-if15.C: New test.
* g++.dg/cpp1z/constexpr-if16.C: New test.

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