[Bug c++/65327] GCC rejects "constexpr volatile int i = 5;"
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 16 09:42:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65327
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-03-16
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed then. I wonder if
--- gcc/cp/decl.c
+++ gcc/cp/decl.c
@@ -10134,8 +10134,9 @@ grokdeclarator (const cp_declarator *declarator,
the object as `const'. */
if (constexpr_p && innermost_code != cdk_function)
{
- if (type_quals & TYPE_QUAL_VOLATILE)
- error ("both %<volatile%> and %<constexpr%> cannot be used here");
+ /* DR1688 says that a `constexpr' specifier in combination with
+ `volatile' is valid. */
+
if (TREE_CODE (type) != REFERENCE_TYPE)
{
type_quals |= TYPE_QUAL_CONST;
is enough...
More information about the Gcc-bugs
mailing list