[Bug c++/86608] [7/8/9 Regression] volatile variable is taken as a constexpr
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Dec 11 18:53:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86608
--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Tue Dec 11 18:53:03 2018
New Revision: 267030
URL: https://gcc.gnu.org/viewcvs?rev=267030&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-volatile2.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
trunk/gcc/cp/decl2.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/pr65327.C
More information about the Gcc-bugs
mailing list