summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-51707.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C17
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/defaulted49.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-dr1397.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C2
6 files changed, 56 insertions, 3 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-51707.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-51707.C
new file mode 100644
index 00000000000..ae02a31c540
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-51707.C
@@ -0,0 +1,14 @@
+// PR c++/51707
+// { dg-do compile { target c++11 } }
+
+struct S {
+ constexpr S() {}
+};
+
+struct T {
+ constexpr T(S const& s) : s{s} {}
+ S const& s;
+};
+
+constexpr S s {};
+constexpr T t { s };
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C
new file mode 100644
index 00000000000..7e4da11a2df
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-aggr1.C
@@ -0,0 +1,17 @@
+// PR c++/60951
+// { dg-do compile { target c++11 } }
+
+struct Foo {
+ constexpr Foo(int x = 0) : memb(x) {}
+ int memb;
+};
+
+struct FooContainer {
+ Foo foo[2];
+};
+
+void fubar() {
+ int nonConst = 0;
+ FooContainer fooContainer;
+ fooContainer = { { 0, nonConst } };
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted49.C b/gcc/testsuite/g++.dg/cpp0x/defaulted49.C
new file mode 100644
index 00000000000..357be419db7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/defaulted49.C
@@ -0,0 +1,15 @@
+// PR c++/60980
+// { dg-do compile { target c++11 } }
+
+struct x0
+{
+ x0 () = default;
+};
+struct x1
+{
+ x0 x2[2];
+ void x3 ()
+ {
+ x1 ();
+ }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C
index 033c14264dd..0f06343958b 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-defer6.C
@@ -1,8 +1,8 @@
// { dg-do compile { target c++11 } }
-struct A // { dg-error "non-static data member" }
+struct A
{
- int i = (A(), 42); // { dg-message "required here" }
+ int i = (A(), 42); // { dg-error "constructor required" }
};
A a;
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-dr1397.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-dr1397.C
new file mode 100644
index 00000000000..061af8b8c29
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-dr1397.C
@@ -0,0 +1,7 @@
+// DR 1397
+// { dg-require-effective-target c++11 }
+
+struct A
+{
+ int i = sizeof(A{}); // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C b/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C
index edcf5887db1..9bc632c4bc7 100644
--- a/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/nsdmi-eh1.C
@@ -1,5 +1,5 @@
// Core issue 1351
-// { dg-do run { xfail *-*-* } }
+// { dg-do run }
// { dg-require-effective-target c++11 }
bool fail;