summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/anonymous-struct.cpp
diff options
context:
space:
mode:
authorCharles Li <charles_li@playstation.sony.com>2016-04-14 23:47:07 +0000
committerCharles Li <charles_li@playstation.sony.com>2016-04-14 23:47:07 +0000
commit1a88adbb27a21e7728253c2f932b41009e314985 (patch)
tree7dafdd87f8d899c1dd638dcd2bc171df4ad58706 /clang/test/SemaCXX/anonymous-struct.cpp
parent4960fbf391360ae04c5815fca2fd647567a977f3 (diff)
downloadbcm5719-llvm-1a88adbb27a21e7728253c2f932b41009e314985.tar.gz
bcm5719-llvm-1a88adbb27a21e7728253c2f932b41009e314985.zip
Lit C++11 Compatibility Patch #8
24 tests have been updated for C++11 compatibility. llvm-svn: 266387
Diffstat (limited to 'clang/test/SemaCXX/anonymous-struct.cpp')
-rw-r--r--clang/test/SemaCXX/anonymous-struct.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/clang/test/SemaCXX/anonymous-struct.cpp b/clang/test/SemaCXX/anonymous-struct.cpp
index 1b5dc13cea0..b584f89ff44 100644
--- a/clang/test/SemaCXX/anonymous-struct.cpp
+++ b/clang/test/SemaCXX/anonymous-struct.cpp
@@ -1,7 +1,12 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
struct S {
- S(); // expected-note {{because type 'S' has a user-provided default constructor}}
+ S();
+#if __cplusplus <= 199711L
+ // expected-note@-2 {{because type 'S' has a user-provided default constructor}}
+#endif
};
struct { // expected-error {{anonymous structs and classes must be class members}}
@@ -9,15 +14,25 @@ struct { // expected-error {{anonymous structs and classes must be class members
struct E {
struct {
- S x; // expected-error {{anonymous struct member 'x' has a non-trivial constructor}}
+ S x;
+#if __cplusplus <= 199711L
+ // expected-error@-2 {{anonymous struct member 'x' has a non-trivial constructor}}
+#endif
};
static struct {
};
};
template <class T> void foo(T);
-typedef struct { // expected-note {{use a tag name here to establish linkage prior to definition}} expected-note {{declared here}}
+typedef struct { // expected-note {{use a tag name here to establish linkage prior to definition}}
+#if __cplusplus <= 199711L
+// expected-note@-2 {{declared here}}
+#endif
+
void test() {
- foo(this); // expected-warning {{template argument uses unnamed type}}
+ foo(this);
+#if __cplusplus <= 199711L
+ // expected-warning@-2 {{template argument uses unnamed type}}
+#endif
}
} A; // expected-error {{unsupported: typedef changes linkage of anonymous type, but linkage was already computed}}
OpenPOWER on IntegriCloud