summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/MicrosoftExtensions.c15
-rw-r--r--clang/test/Sema/anonymous-struct-union.c2
2 files changed, 16 insertions, 1 deletions
diff --git a/clang/test/Sema/MicrosoftExtensions.c b/clang/test/Sema/MicrosoftExtensions.c
index 429dd943a74..f64012098b2 100644
--- a/clang/test/Sema/MicrosoftExtensions.c
+++ b/clang/test/Sema/MicrosoftExtensions.c
@@ -39,9 +39,24 @@ struct nested2 {
NESTED1; // expected-warning {{anonymous structs are a Microsoft extension}}
};
+struct nested3 {
+ long d;
+ struct nested4 { // expected-warning {{anonymous structs are a Microsoft extension}}
+ long e;
+ };
+ union nested5 { // expected-warning {{anonymous unions are a Microsoft extension}}
+ long f;
+ };
+};
+
+typedef union nested6 {
+ long f;
+} NESTED6;
+
struct test {
int c;
struct nested2; // expected-warning {{anonymous structs are a Microsoft extension}}
+ NESTED6; // expected-warning {{anonymous unions are a Microsoft extension}}
};
void foo()
diff --git a/clang/test/Sema/anonymous-struct-union.c b/clang/test/Sema/anonymous-struct-union.c
index 35d31754162..26dbeb87f5f 100644
--- a/clang/test/Sema/anonymous-struct-union.c
+++ b/clang/test/Sema/anonymous-struct-union.c
@@ -37,7 +37,7 @@ void test_unqual_references(struct X x, const struct X xc) {
struct Redecl {
int x; // expected-note{{previous declaration is here}}
- struct y { };
+ struct y { }; // expected-warning{{declaration does not declare anything}}
union {
int x; // expected-error{{member of anonymous union redeclares 'x'}}
OpenPOWER on IntegriCloud