From 2e7cba62082a40061fd34343f6c31c56bb006ff5 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 6 Mar 2009 23:06:59 +0000 Subject: 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 --- clang/test/Sema/anonymous-struct-union.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'clang/test/Sema/anonymous-struct-union.c') 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}} -- cgit v1.2.3