diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-18 22:52:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-03-18 22:52:47 +0000 |
commit | c7f811638f8603fa373d2be724e8b1c8ba51ad75 (patch) | |
tree | d338d2c57d4b01c3e7ce858c1586e6cc9ed5f518 /test/Sema | |
parent | 0378433dcdf9a5701207c2a592b10da71ad9ba5d (diff) |
Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177335 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/anonymous-struct-union.c | 2 | ||||
-rw-r--r-- | test/Sema/decl-invalid.c | 4 | ||||
-rw-r--r-- | test/Sema/declspec.c | 2 | ||||
-rw-r--r-- | test/Sema/struct-decl.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/test/Sema/anonymous-struct-union.c b/test/Sema/anonymous-struct-union.c index e0822901b0..35d3175416 100644 --- a/test/Sema/anonymous-struct-union.c +++ b/test/Sema/anonymous-struct-union.c @@ -78,7 +78,7 @@ void g() { struct s0 { union { int f0; }; }; // <rdar://problem/6481130> -typedef struct { }; // expected-warning{{declaration does not declare anything}} +typedef struct { }; // expected-warning{{typedef requires a name}} // PR3675 struct s1 { diff --git a/test/Sema/decl-invalid.c b/test/Sema/decl-invalid.c index f6fed3c92d..0544304c20 100644 --- a/test/Sema/decl-invalid.c +++ b/test/Sema/decl-invalid.c @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify // See Sema::ParsedFreeStandingDeclSpec about the double diagnostic -typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{declaration does not declare anything}} +typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{typedef requires a name}} // PR2017 @@ -14,7 +14,7 @@ int a() { } int; // expected-warning {{declaration does not declare anything}} -typedef int; // expected-warning {{declaration does not declare anything}} +typedef int; // expected-warning {{typedef requires a name}} const int; // expected-warning {{declaration does not declare anything}} struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}} typedef int I; diff --git a/test/Sema/declspec.c b/test/Sema/declspec.c index 7354028cba..30c009201c 100644 --- a/test/Sema/declspec.c +++ b/test/Sema/declspec.c @@ -10,7 +10,7 @@ int typedef validTypeDecl() { } // expected-error {{function definition declared struct _zend_module_entry { } // expected-error {{expected ';' after struct}} int gv1; typedef struct _zend_function_entry { } // expected-error {{expected ';' after struct}} \ - // expected-warning {{declaration does not declare anything}} + // expected-warning {{typedef requires a name}} int gv2; static void buggy(int *x) { } diff --git a/test/Sema/struct-decl.c b/test/Sema/struct-decl.c index 6070e875f5..819e856ac8 100644 --- a/test/Sema/struct-decl.c +++ b/test/Sema/struct-decl.c @@ -54,6 +54,6 @@ static struct test1 { // expected-warning {{'static' ignored on this declaration const struct test2 { // expected-warning {{'const' ignored on this declaration}} int x; }; -inline struct test3 { // expected-warning {{'inline' ignored on this declaration}} +inline struct test3 { // expected-error {{'inline' can only appear on functions}} int x; }; |