summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-array16.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-array16.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-array16.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-array16.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-array16.C
new file mode 100644
index 0000000000..af2e58d142
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-array16.C
@@ -0,0 +1,23 @@
+// PR c++/71166
+// { dg-do compile { target c++11 } }
+
+struct Foo { int value; };
+
+constexpr Foo MakeFoo() { return Foo{0}; }
+
+struct Bar {
+ Foo color = MakeFoo();
+};
+
+struct BarContainer {
+ Bar array[1];
+};
+
+Foo X ()
+{
+ return MakeFoo ();
+}
+
+void Foo() {
+ new BarContainer();
+}