PR c++/81676 - bogus -Wunused warnings in constexpr if.
authorMarek Polacek <polacek@redhat.com>
Wed, 28 Aug 2019 02:22:29 +0000 (02:22 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 28 Aug 2019 02:22:29 +0000 (02:22 +0000)
commit8692693732e89806058d3b9c91132fb83661b214
tree4d6fb359b2dfa84fd95432293af3448db1c32dd2
parent14da3939da3adcef84816573caa9d93c7367507e
PR c++/81676 - bogus -Wunused warnings in constexpr if.

* semantics.c (maybe_mark_exp_read_r): New function.
(finish_if_stmt): Call it on THEN_CLAUSE and ELSE_CLAUSE.

* g++.dg/cpp1z/constexpr-if31.C: New test.
* g++.dg/cpp1z/constexpr-if32.C: New test.

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