summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2016-09-20 21:49:12 +0000
commitc9c81ef3c667aaa14c498a5449ec6d134b4b66ff (patch)
tree0ac440db6513ee01deb5e5dc6142769d1e5b7b2d /gcc/testsuite/g++.dg/cpp0x
parent12cdcb9d74f55c165366ca1b1eeec013a0ce72ef (diff)
parent891196d7325e4c55d92d5ac5cfe7161c4f36c0ce (diff)
downloadgcc-fortran-dev.tar.gz
Merge from trunk (r239915 to r240230)fortran-dev
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/fortran-dev@240290 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/Wattributes1.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-77482.C6
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype-77338.C7
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-52.C9
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-61.C10
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/mutable1.C12
7 files changed, 43 insertions, 5 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C b/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C
index dd9011b8870..b0a1e864eff 100644
--- a/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C
@@ -5,4 +5,4 @@
#include <new>
__attribute__((visibility("hidden")))void*operator new(std::size_t); // { dg-warning "visibility attribute ignored" }
-// { dg-message "previous declaration" "" { target *-*-* } 116 }
+// { dg-message "previous declaration" "" { target *-*-* } 120 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-77482.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-77482.C
new file mode 100644
index 00000000000..6f5c91621ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-77482.C
@@ -0,0 +1,6 @@
+// PR c++/77482
+// { dg-do compile { target c++11 } }
+
+constexpr auto x; // { dg-error "declaration\[^\n\r]*has no initializer" }
+extern struct S s;
+constexpr auto y = s; // { dg-error "has incomplete type" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-77338.C b/gcc/testsuite/g++.dg/cpp0x/decltype-77338.C
new file mode 100644
index 00000000000..4ba7c96d32c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype-77338.C
@@ -0,0 +1,7 @@
+// PR c++/77338
+// { dg-do compile { target c++11 } }
+
+struct S;
+
+template <typename>
+auto f (S s) -> decltype (s (s)); // { dg-error "no match for call to" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-52.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-52.C
index 0f87fd490e5..ad7cffc6b99 100644
--- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-52.C
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-52.C
@@ -3,19 +3,22 @@
struct A {int i;} a [[gnu::aligned(16)]];
struct B {int i;} __attribute__((aligned(16))) b;
+constexpr unsigned si = sizeof(int);
+constexpr unsigned ai = alignof(int);
+
int
main ()
{
A aa;
B bb;
- static_assert (sizeof (a) == 4, "sizeof (a) should be 4");
+ static_assert (sizeof (a) == si, "sizeof (a) should be 4");
static_assert (sizeof (b) == 16, "sizeof (b) should be 16");
- static_assert (sizeof (aa) == 4, "sizeof (aa) should be 4");
+ static_assert (sizeof (aa) == si, "sizeof (aa) should be 4");
static_assert (sizeof (bb) == 16, "sizeof (bb) should be 16");
static_assert (__alignof__ (a) == 16, "alignof (a) should be 16");
static_assert (__alignof__ (b) == 16, "alignof (b) should be 16");
- static_assert (__alignof__ (aa) == 4, "alignof (aa) should be 4");
+ static_assert (__alignof__ (aa) == ai, "alignof (aa) should be 4");
static_assert (__alignof__ (bb) == 16, "alignof (bb) should be 16");
}
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-61.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-61.C
new file mode 100644
index 00000000000..fd7f4437dbb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-61.C
@@ -0,0 +1,10 @@
+// { dg-do compile { target c++11 } }
+int
+foo ()
+{
+ int i [[and::bitor, bar::xor_eq, compl::baz(1), bitand::xor_eq(2, 3)]]; // { dg-warning "ignored" }
+ int j [[using, using::baz, bar::using, using::using (2)]]; // { dg-warning "ignored" }
+ i = 0;
+ j = 0;
+ return i + j;
+}
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
index 20ef282ac24..15b8b79ecbc 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-mangle.C
@@ -1,6 +1,6 @@
// Test lambda mangling
-// { dg-require-weak "" }
// { dg-do compile { target c++11 } }
+// { dg-require-weak "" }
// { dg-options "-fno-inline" }
template<typename F> int algo(F fn) { return fn(); }
diff --git a/gcc/testsuite/g++.dg/cpp0x/mutable1.C b/gcc/testsuite/g++.dg/cpp0x/mutable1.C
new file mode 100644
index 00000000000..4dd37185d72
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/mutable1.C
@@ -0,0 +1,12 @@
+// PR c++/77375
+// { dg-do run { target c++11 } }
+
+struct Base { mutable int i; };
+struct Derived : Base {};
+const Derived foo{};
+
+int
+main ()
+{
+ foo.i = 42;
+}