diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGenCXX/debug-info-use-after-free.cpp | 3 | ||||
-rw-r--r-- | test/Misc/warning-flags.c | 3 | ||||
-rw-r--r-- | test/Parser/c11-noreturn.c | 6 | ||||
-rw-r--r-- | test/Parser/cxx-class.cpp | 11 | ||||
-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 | ||||
-rw-r--r-- | test/SemaCXX/anonymous-union.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/storage-class.cpp | 2 |
10 files changed, 26 insertions, 11 deletions
diff --git a/test/CodeGenCXX/debug-info-use-after-free.cpp b/test/CodeGenCXX/debug-info-use-after-free.cpp index 9757ca4d37..852e148956 100644 --- a/test/CodeGenCXX/debug-info-use-after-free.cpp +++ b/test/CodeGenCXX/debug-info-use-after-free.cpp @@ -192,6 +192,7 @@ __gnu_cxx { public: typedef _EqualKey key_equal; + typedef void key_type; }; using std::equal_to; @@ -217,7 +218,7 @@ __gnu_cxx { _Alloc > _Ht; public: - typename _Ht::key_type; + typedef typename _Ht::key_type key_type; typedef typename _Ht::key_equal key_equal; diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 931de8365b..a6dc8f1352 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -18,7 +18,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (144): +CHECK: Warnings without flags (143): CHECK-NEXT: ext_delete_void_ptr_operand CHECK-NEXT: ext_enum_friend CHECK-NEXT: ext_expected_semi_decl_list @@ -148,7 +148,6 @@ CHECK-NEXT: warn_related_result_type_compatibility_class CHECK-NEXT: warn_related_result_type_compatibility_protocol CHECK-NEXT: warn_second_parameter_of_va_start_not_last_named_argument CHECK-NEXT: warn_second_parameter_to_va_arg_never_compatible -CHECK-NEXT: warn_standalone_specifier CHECK-NEXT: warn_static_inline_explicit_inst_ignored CHECK-NEXT: warn_static_non_static CHECK-NEXT: warn_template_export_unsupported diff --git a/test/Parser/c11-noreturn.c b/test/Parser/c11-noreturn.c index 7a2fe50f88..e61901dfb7 100644 --- a/test/Parser/c11-noreturn.c +++ b/test/Parser/c11-noreturn.c @@ -4,11 +4,15 @@ _Noreturn int f(); int _Noreturn f(); // expected-note {{previous}} int f _Noreturn(); // expected-error {{expected ';'}} expected-error 2{{}} -int f() _Noreturn; // expected-error {{expected ';'}} expected-warning {{does not declare anything}} +int f() _Noreturn; // expected-error {{expected ';'}} expected-warning {{does not declare anything}} expected-error {{'_Noreturn' can only appear on functions}} _Noreturn char c1; // expected-error {{'_Noreturn' can only appear on functions}} char _Noreturn c2; // expected-error {{'_Noreturn' can only appear on functions}} typedef _Noreturn int g(); // expected-error {{'_Noreturn' can only appear on functions}} +_Noreturn int; // expected-error {{'_Noreturn' can only appear on functions}} expected-warning {{does not declare anything}} +_Noreturn struct S; // expected-error {{'_Noreturn' can only appear on functions}} +_Noreturn enum E { e }; // expected-error {{'_Noreturn' can only appear on functions}} + // CHECK-EXT: _Noreturn functions are a C11-specific feature diff --git a/test/Parser/cxx-class.cpp b/test/Parser/cxx-class.cpp index 8ed5882a28..5fac797285 100644 --- a/test/Parser/cxx-class.cpp +++ b/test/Parser/cxx-class.cpp @@ -88,6 +88,17 @@ namespace ctor_error { // expected-error{{unknown type name 'UnknownType'}} } +namespace nns_decl { + struct A { + struct B; + }; + namespace N { + union C; + } + struct A::B; // expected-error {{forward declaration of struct cannot have a nested name specifier}} + union N::C; // expected-error {{forward declaration of union cannot have a nested name specifier}} +} + // PR13775: Don't assert here. namespace PR13775 { class bar 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; }; diff --git a/test/SemaCXX/anonymous-union.cpp b/test/SemaCXX/anonymous-union.cpp index 93b5b0abba..9c2cf24a83 100644 --- a/test/SemaCXX/anonymous-union.cpp +++ b/test/SemaCXX/anonymous-union.cpp @@ -110,7 +110,7 @@ struct BadMembers { }; // <rdar://problem/6481130> -typedef union { }; // expected-warning{{declaration does not declare anything}} +typedef union { }; // expected-warning{{typedef requires a name}} // <rdar://problem/7562438> typedef struct objc_module *Foo ; diff --git a/test/SemaCXX/storage-class.cpp b/test/SemaCXX/storage-class.cpp index 01cfbfc51f..74121843e5 100644 --- a/test/SemaCXX/storage-class.cpp +++ b/test/SemaCXX/storage-class.cpp @@ -3,5 +3,5 @@ extern const int PR6495a = 42; extern int PR6495b = 42; // expected-warning{{'extern' variable has an initializer}} extern const int PR6495c[] = {42,43,44}; -extern struct Test1 {}; // expected-warning {{'extern' ignored on this declaration}} +extern struct Test1 {}; // expected-warning {{'extern' is not permitted on a declaration of a type}} extern "C" struct Test0 {}; // no warning |