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/addressof3.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-inhctor1.C4
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor11a.C15
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor15a.C14
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C16
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C1
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor3a.C21
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr77948-1.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr77948-2.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr77948-3.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr77948-4.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr77948-5.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr77948-6.C10
17 files changed, 142 insertions, 4 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/addressof3.C b/gcc/testsuite/g++.dg/cpp0x/addressof3.C
new file mode 100644
index 00000000000..fa517908ae3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/addressof3.C
@@ -0,0 +1,9 @@
+// { dg-do compile }
+
+struct S { int foo (); int s; };
+int a[10];
+int b;
+S c;
+int d = __builtin_addressof (a)[0][0];
+int e = __builtin_addressof (b)[0];
+int f = __builtin_addressof (c)->foo ();
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-inhctor1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-inhctor1.C
index ee8757f4dcf..98691101e86 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-inhctor1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-inhctor1.C
@@ -9,7 +9,7 @@ struct A
struct B : A
{
- using A::A; // { dg-error "A::i" }
+ using A::A; // { dg-prune-output "A::i" }
};
-constexpr B b(0); // { dg-error "B::B" }
+constexpr B b(0); // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C
index 228e8ec6609..4fc67a4a56a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor11.C
@@ -1,4 +1,5 @@
// { dg-do compile { target c++11 } }
+// { dg-options -fno-new-inheriting-ctors }
struct A
{
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor11a.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor11a.C
new file mode 100644
index 00000000000..61b251eb0ba
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor11a.C
@@ -0,0 +1,15 @@
+// { dg-do compile { target c++11 } }
+// { dg-options -fnew-inheriting-ctors }
+
+struct A
+{
+ A(int, ...);
+};
+
+struct B: A
+{
+ using A::A;
+};
+
+B b1(42);
+B b2(42, 1.0); // { dg-bogus "ellipsis" "" { xfail *-*-* } }
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C
index c2d33bff4ff..a0b518c19d3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C
@@ -2,6 +2,7 @@
// constructors was a deliberate choice.
// { dg-do compile { target c++11 } }
+// { dg-options -fno-new-inheriting-ctors }
struct A { A(int); };
struct B: public A
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor15a.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor15a.C
new file mode 100644
index 00000000000..a9abb8428a1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor15a.C
@@ -0,0 +1,14 @@
+// P0136 caused us to start inheriting base copy constructors.
+// { dg-do compile { target c++11 } }
+// { dg-options -fnew-inheriting-ctors }
+
+struct A { A(int); };
+struct B: public A
+{
+ using A::A;
+};
+
+A a (42);
+
+B b1 (24); // inherited
+B b2 (a); // also inherited now
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C
new file mode 100644
index 00000000000..1b0e2425cc2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C
@@ -0,0 +1,16 @@
+// { dg-do compile { target c++11 } }
+
+class A { };
+template<typename> using UniquePtr = int;
+template<typename AllocPolicy> struct BufferList {
+ BufferList(unsigned, unsigned, unsigned, AllocPolicy = AllocPolicy());
+};
+class D : BufferList<A> {
+ using BufferList::BufferList;
+};
+template<typename , typename... Args> UniquePtr<D> MakeUnique(Args... aArgs)
+{
+ D d(aArgs...);
+ return 0;
+}
+UniquePtr<D> setCloneBuffer_impl_buf = MakeUnique<D>(0, 0, 0);
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
index e8dc84d32ec..8cbeed66047 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor3.C
@@ -1,4 +1,5 @@
// { dg-do compile { target c++11 } }
+// { dg-options -fno-new-inheriting-ctors }
struct B1 {
B1(int);
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor3a.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor3a.C
new file mode 100644
index 00000000000..c9b4ea11412
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor3a.C
@@ -0,0 +1,21 @@
+// { dg-do compile { target c++11 } }
+// { dg-options -fnew-inheriting-ctors }
+
+struct B1 {
+ B1(int);
+};
+struct B2 {
+ B2(int);
+};
+struct D1 : B1, B2 {
+ using B1::B1;
+ using B2::B2;
+}; // ambiguous
+struct D2 : B1, B2 {
+ using B1::B1;
+ using B2::B2;
+ D2(int); // OK: user declaration supersedes both implicit declarations
+};
+
+D2 d2(42);
+D1 d1(42); // { dg-error "ambiguous" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C
index 8c79c833a32..d0038c16a14 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor5.C
@@ -15,7 +15,7 @@ void test() {
D1 e; // { dg-error "deleted" } D1 has no default constructor
}
struct D2 : B2 {
- using B2::B2; // { dg-error "no match" } implicitly declares D2(double)
+ using B2::B2; // { dg-error "B1::B1" }
B1 b;
};
D2 f(1.0); // { dg-error "deleted" } B1 has no default constructor
diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C
index 676605db9e9..5bfdd499d46 100644
--- a/gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C
+++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor9.C
@@ -9,7 +9,7 @@ protected:
struct B: A
{
- using A::A; // { dg-message "protected" }
+ using A::A;
};
B b(42); // { dg-error "this context" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr77948-1.C b/gcc/testsuite/g++.dg/cpp0x/pr77948-1.C
new file mode 100644
index 00000000000..e7795e95b7f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr77948-1.C
@@ -0,0 +1,10 @@
+// PR c++/77948
+// { dg-do compile }
+// { dg-options "-std=c++11 -std=gnu++11" }
+
+void
+foo ()
+{
+ auto qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } }
+ auto Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr77948-2.C b/gcc/testsuite/g++.dg/cpp0x/pr77948-2.C
new file mode 100644
index 00000000000..7b84c5fdea1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr77948-2.C
@@ -0,0 +1,10 @@
+// PR c++/77948
+// { dg-do compile }
+// { dg-options "-std=gnu++11 -std=c++11" }
+
+void
+foo ()
+{
+ auto qfp = 1.0q; // { dg-error "unable to find numeric literal operator" }
+ auto Qfp = 1.0Q; // { dg-error "unable to find numeric literal operator" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr77948-3.C b/gcc/testsuite/g++.dg/cpp0x/pr77948-3.C
new file mode 100644
index 00000000000..64d4f5b14cc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr77948-3.C
@@ -0,0 +1,10 @@
+// PR c++/77948
+// { dg-do compile }
+// { dg-options "-std=c++11 -std=gnu++98" }
+
+void
+foo ()
+{
+ double qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } }
+ double Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr77948-4.C b/gcc/testsuite/g++.dg/cpp0x/pr77948-4.C
new file mode 100644
index 00000000000..7b66b983bfa
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr77948-4.C
@@ -0,0 +1,10 @@
+// PR c++/77948
+// { dg-do compile }
+// { dg-options "-std=c++11 -std=c++98" }
+
+void
+foo ()
+{
+ double qfp = 1.0q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } }
+ double Qfp = 1.0Q; // { dg-error "unsupported" "" { target { ! has_q_floating_suffix } } }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr77948-5.C b/gcc/testsuite/g++.dg/cpp0x/pr77948-5.C
new file mode 100644
index 00000000000..bec34a15fbd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr77948-5.C
@@ -0,0 +1,10 @@
+// PR c++/77948
+// { dg-do compile }
+// { dg-options "-std=gnu++98 -std=c++11" }
+
+void
+foo ()
+{
+ auto qfp = 1.0q; // { dg-error "unable to find numeric literal operator" }
+ auto Qfp = 1.0Q; // { dg-error "unable to find numeric literal operator" }
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr77948-6.C b/gcc/testsuite/g++.dg/cpp0x/pr77948-6.C
new file mode 100644
index 00000000000..b8a13b5540a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/pr77948-6.C
@@ -0,0 +1,10 @@
+// PR c++/77948
+// { dg-do compile }
+// { dg-options "-std=c++98 -std=c++11" }
+
+void
+foo ()
+{
+ auto qfp = 1.0q; // { dg-error "unable to find numeric literal operator" }
+ auto Qfp = 1.0Q; // { dg-error "unable to find numeric literal operator" }
+}