re PR c++/83692 (Rejects valid constexpr with unrelated code fixing problem)
authorMarek Polacek <polacek@redhat.com>
Sat, 24 Feb 2018 13:10:44 +0000 (13:10 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Sat, 24 Feb 2018 13:10:44 +0000 (13:10 +0000)
commit118cd6baeda97b91c667bb5933a56a72f8c0dc84
tree57b3ceeb33137e764e6de70a18d9ce21210db308
parent2d98a9c1d52be9e77dfe163b83f27879f7bcda98
re PR c++/83692 (Rejects valid constexpr with unrelated code fixing problem)

PR c++/83692
* constexpr.c (maybe_constant_init_1): New function.
(maybe_constant_init): Make it a wrapper around maybe_constant_init_1.
(cxx_constant_init): New function.
* cp-tree.h (cxx_constant_init): Declare.
* typeck2.c (store_init_value): Call cxx_constant_init instead of
cxx_constant_value.  Move the maybe_constant_init call under an 'else'.

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

From-SVN: r257961
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/typeck2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/constexpr-83692.C [new file with mode: 0644]