re PR c++/57820 ([DR 253] NSDMI and const objects)
authorPaolo Carlini <paolo.carlini@oracle.com>
Mon, 3 Nov 2014 10:49:05 +0000 (10:49 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Mon, 3 Nov 2014 10:49:05 +0000 (10:49 +0000)
2014-11-03  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/57820
* g++.dg/cpp0x/constexpr-ctor16.C: New.
* g++.dg/cpp0x/constexpr-ctor17.C: Likewise.

From-SVN: r217035

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C [new file with mode: 0644]

index 7e97d61895f0599cb6ba388ccf10296cd72365b9..480e139387abdd311e105c86e7bc46b6dab8c3e4 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-03  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/57820
+       * g++.dg/cpp0x/constexpr-ctor16.C: New.
+       * g++.dg/cpp0x/constexpr-ctor17.C: Likewise.
+
 2014-11-03  Marc Glisse  <marc.glisse@inria.fr>
 
        PR tree-optimization/60770
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor16.C
new file mode 100644 (file)
index 0000000..12aaeeb
--- /dev/null
@@ -0,0 +1,11 @@
+// PR c++/57820
+// { dg-do compile { target c++11 } }
+
+struct C
+{
+  int a = 2;
+  int b = a + 1;
+};
+
+C c;
+constexpr C d = {};
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-ctor17.C
new file mode 100644 (file)
index 0000000..ed82a14
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/57820
+// { dg-do compile { target c++11 } }
+
+struct C
+{
+  int a = 2;
+  int b = a + 1;
+
+  constexpr C() {}
+};
+
+C c;
+constexpr C d;