From a2b5e31cb19f4fd4680e7230cd5497f5ef09a438 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Sun, 28 Dec 2008 15:28:59 +0000 Subject: Diagnose declarations that don't declare anything, and fix PR3020. Examples: int; typedef int; llvm-svn: 61454 --- clang/test/Sema/decl-invalid.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'clang/test/Sema/decl-invalid.c') diff --git a/clang/test/Sema/decl-invalid.c b/clang/test/Sema/decl-invalid.c index 767d6e6ab40..78a9ee1d4bf 100644 --- a/clang/test/Sema/decl-invalid.c +++ b/clang/test/Sema/decl-invalid.c @@ -1,6 +1,7 @@ // RUN: clang %s -fsyntax-only -verify -typedef union __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} +// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic +typedef union __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-error {{declaration does not declare anything}} // PR2017 @@ -9,3 +10,9 @@ int a() { int r[x()]; // expected-error {{size of array has non-integer type 'void'}} } +int; // expected-error {{declaration does not declare anything}} +typedef int; // expected-error {{declaration does not declare anything}} +const int; // expected-error {{declaration does not declare anything}} +struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}} +typedef int I; +I; // expected-error {{declaration does not declare anything}} -- cgit v1.2.3