summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/anonymous-union.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/anonymous-union.cpp')
-rw-r--r--test/SemaCXX/anonymous-union.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/SemaCXX/anonymous-union.cpp b/test/SemaCXX/anonymous-union.cpp
index 2dd7ab8..9c2cf24 100644
--- a/test/SemaCXX/anonymous-union.cpp
+++ b/test/SemaCXX/anonymous-union.cpp
@@ -9,7 +9,7 @@ struct X {
int i;
float f;
- union {
+ union { // expected-warning{{anonymous types declared in an anonymous union are an extension}}
float f2;
mutable double d;
};
@@ -101,7 +101,7 @@ void g() {
struct BadMembers {
union {
struct X { }; // expected-error {{types cannot be declared in an anonymous union}}
- struct { int x; int y; } y;
+ struct { int x; int y; } y; // expected-warning{{anonymous types declared in an anonymous union are an extension}}
void f(); // expected-error{{functions cannot be declared in an anonymous union}}
private: int x1; // expected-error{{anonymous union cannot contain a private data member}}
@@ -110,7 +110,7 @@ struct BadMembers {
};
// <rdar://problem/6481130>
-typedef union { }; // expected-warning{{declaration does not declare anything}}
+typedef union { }; // expected-warning{{typedef requires a name}}
// <rdar://problem/7562438>
typedef struct objc_module *Foo ;
@@ -128,7 +128,7 @@ namespace test4 {
struct { // expected-warning{{anonymous structs are a GNU extension}}
int s0; // expected-note {{declared private here}}
double s1; // expected-note {{declared private here}}
- union {
+ union { // expected-warning{{anonymous types declared in an anonymous struct are an extension}}
int su0; // expected-note {{declared private here}}
double su1; // expected-note {{declared private here}}
};
@@ -136,7 +136,7 @@ namespace test4 {
union {
int u0; // expected-note {{declared private here}}
double u1; // expected-note {{declared private here}}
- struct { // expected-warning{{anonymous structs are a GNU extension}}
+ struct { // expected-warning{{anonymous structs are a GNU extension}} expected-warning{{anonymous types declared in an anonymous union are an extension}}
int us0; // expected-note {{declared private here}}
double us1; // expected-note {{declared private here}}
};
@@ -187,7 +187,7 @@ namespace PR8326 {
private:
const union { // expected-warning{{anonymous union cannot be 'const'}}
- struct { // expected-warning{{anonymous structs are a GNU extension}}
+ struct { // expected-warning{{anonymous structs are a GNU extension}} expected-warning{{declared in an anonymous union}}
T x;
T y;
};
OpenPOWER on IntegriCloud