PR c++/86608 - reading constexpr volatile variable.
authorMarek Polacek <polacek@redhat.com>
Tue, 11 Dec 2018 18:53:03 +0000 (18:53 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 11 Dec 2018 18:53:03 +0000 (18:53 +0000)
commit3c393a2c012f7f5f1c3df7d6d7b17a9cf992af17
tree9399e03173df7dd5a900525cc3a7067fd3268390
parent6b9ef867ec3230abcfb67cbe93f3e7dd5ecfbf47
PR c++/86608 - reading constexpr volatile variable.

* constexpr.c (potential_constant_expression_1): Check want_rval
instead of checking if we have a decl.
* decl2.c (decl_maybe_constant_var_p): Don't consider volatile
constexpr variables as maybe constant.

* g++.dg/cpp0x/constexpr-volatile2.C: New test.
* g++.dg/cpp0x/pr65327.C: Add dg-error.

From-SVN: r267030
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/decl2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-volatile2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr65327.C