+2015-03-16 Marek Polacek <polacek@redhat.com>
+
+ DR 1688
+ PR c++/65327
+ * decl.c (grokdeclarator): Allow volatile and constexpr together.
+
2015-03-12 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/65323
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;
+2015-03-16 Marek Polacek <polacek@redhat.com>
+
+ DR 1688
+ PR c++/65327
+ * g++.dg/cpp0x/constexpr-object1.C: Change dg-error to dg-bogus.
+ * g++.dg/cpp0x/pr65327.C: New test.
+
2015-03-16 Max Ostapenko <m.ostapenko@partner.samsung.com>
PR sanitizer/64820
const constexpr A1 a3 = A1();
-volatile constexpr A1 a4 = A1(); // { dg-error "both .volatile. and .constexpr. cannot" }
+volatile constexpr A1 a4 = A1(); // { dg-bogus "both .volatile. and .constexpr. cannot" }
// error: on type declaration
constexpr struct pixel
--- /dev/null
+// PR c++/65327
+// { dg-do compile { target c++11 } }
+// DR1688 says that constexpr can be used together with volatile.
+
+constexpr volatile int i = 10;
+
+void
+foo ()
+{
+ constexpr volatile int j = 5;
+ static constexpr volatile int k = 5;
+}
+
+constexpr volatile int
+bar ()
+{
+ return i;
+}