PR c++/84854
commit8fa8b689f0c8a8ab8964d5d2fbf811ce3ece9514
authormpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Mar 2018 08:08:07 +0000 (22 08:08 +0000)
committermpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 22 Mar 2018 08:08:07 +0000 (22 08:08 +0000)
treef9899378cfb63c1e7528b102e9bd49112f356ce1
parentb248e783b3fc67e21fd0abb9ce4c9ee6d8b2fd20
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.

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