summaryrefslogtreecommitdiffstats
path: root/clang/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
commit2e7cba62082a40061fd34343f6c31c56bb006ff5 (patch)
tree8f0736a5a22426c03e41fabdc138062eec733d9a /clang/test/Sema/anonymous-struct-union.c
parentf5d0613ce9afa2db0b34d9b5805ebeef6ec81162 (diff)
downloadbcm5719-llvm-2e7cba62082a40061fd34343f6c31c56bb006ff5.tar.gz
bcm5719-llvm-2e7cba62082a40061fd34343f6c31c56bb006ff5.zip
Use the 'declaration does not declare anything' error when we see an anonymous struct/union declaration outside of a struct or union in C
llvm-svn: 66303
Diffstat (limited to 'clang/test/Sema/anonymous-struct-union.c')
-rw-r--r--clang/test/Sema/anonymous-struct-union.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/test/Sema/anonymous-struct-union.c b/clang/test/Sema/anonymous-struct-union.c
index 4e699ab2ff4..d8a445c6491 100644
--- a/clang/test/Sema/anonymous-struct-union.c
+++ b/clang/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}}
OpenPOWER on IntegriCloud