aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/MicrosoftExtensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/MicrosoftExtensions.c')
-rw-r--r--test/Sema/MicrosoftExtensions.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Sema/MicrosoftExtensions.c b/test/Sema/MicrosoftExtensions.c
index 429dd943a746..e7032305fc07 100644
--- a/test/Sema/MicrosoftExtensions.c
+++ b/test/Sema/MicrosoftExtensions.c
@@ -39,9 +39,26 @@ struct nested2 {
NESTED1; // expected-warning {{anonymous structs are a Microsoft extension}}
};
+struct nested2 PR20573 = { .a = 3 };
+
+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()
@@ -87,6 +104,14 @@ typedef struct {
AA; // expected-warning {{anonymous structs are a Microsoft extension}}
} BB;
+struct anon_fault {
+ struct undefined; // expected-warning {{anonymous structs are a Microsoft extension}}
+ // expected-error@-1 {{field has incomplete type 'struct undefined'}}
+ // expected-note@-2 {{forward declaration of 'struct undefined'}}
+};
+
+const int anon_falt_size = sizeof(struct anon_fault);
+
__declspec(deprecated("This is deprecated")) enum DE1 { one, two } e1; // expected-note {{'e1' has been explicitly marked deprecated here}}
struct __declspec(deprecated) DS1 { int i; float f; }; // expected-note {{'DS1' has been explicitly marked deprecated here}}