aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/anonymous-struct-union.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-06 23:06:59 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-06 23:06:59 +0000
commita71c129fb8052a143cbf548963a8db2150b0078e (patch)
treed8b30db92ff1c3483d2a52d8ffff57e2e777ce05 /test/Sema/anonymous-struct-union.c
parenta6e27790acb6d06be6c1113ea94165c4b7e056cd (diff)
Use the 'declaration does not declare anything' error when we see an anonymous struct/union declaration outside of a struct or union in C
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/anonymous-struct-union.c')
-rw-r--r--test/Sema/anonymous-struct-union.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/Sema/anonymous-struct-union.c b/test/Sema/anonymous-struct-union.c
index 4e699ab2ff..d8a445c649 100644
--- a/test/Sema/anonymous-struct-union.c
+++ b/test/Sema/anonymous-struct-union.c
@@ -50,12 +50,12 @@ struct Redecl {
void zz(); // expected-error{{duplicate member 'zz'}}
};
-union { // expected-error{{anonymous unions must be struct or union members}}
+union { // expected-error{{declaration does not declare anything}}
int int_val;
float float_val;
};
-static union { // expected-error{{anonymous unions must be struct or union members}}
+static union { // expected-error{{declaration does not declare anything}}
int int_val2;
float float_val2;
};
@@ -66,7 +66,7 @@ void f() {
}
void g() {
- union { // expected-error{{anonymous unions must be struct or union members}}
+ union { // expected-error{{declaration does not declare anything}}
int i;
float f2;
};
@@ -87,3 +87,5 @@ struct s1 {
int f0; // expected-error{{member of anonymous union redeclares 'f0'}}
};
};
+
+struct {}; // expected-error{{declaration does not declare anything}}