summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2017-11-26 20:01:12 +0000
committerAaron Ballman <aaron@aaronballman.com>2017-11-26 20:01:12 +0000
commitadf66b617461c250ad75163c938a1887a47adafb (patch)
tree2fa25db52e8db8687c8cbe2a7aac93c2235af22c /clang/test
parent9d68565262401bd9d26c69ec496e76e92616d8df (diff)
downloadbcm5719-llvm-adf66b617461c250ad75163c938a1887a47adafb.tar.gz
bcm5719-llvm-adf66b617461c250ad75163c938a1887a47adafb.zip
Determine the attribute subject for diagnostics based on declarative information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing.
This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). llvm-svn: 319002
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp6
-rw-r--r--clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp2
-rw-r--r--clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m6
-rw-r--r--clang/test/Misc/pragma-attribute-supported-attributes-list.test4
-rw-r--r--clang/test/Parser/MicrosoftExtensions.cpp4
-rw-r--r--clang/test/Parser/cxx0x-attributes.cpp2
-rw-r--r--clang/test/Parser/ms-square-bracket-attributes.mm2
-rw-r--r--clang/test/Sema/attr-capabilities.c4
-rw-r--r--clang/test/Sema/attr-disable-tail-calls.c2
-rw-r--r--clang/test/Sema/attr-minsize.c2
-rw-r--r--clang/test/Sema/attr-mode.c4
-rw-r--r--clang/test/Sema/attr-nodebug.c2
-rw-r--r--clang/test/Sema/attr-section.c4
-rw-r--r--clang/test/Sema/attr-weak.c4
-rw-r--r--clang/test/Sema/builtin-assume-aligned.c2
-rw-r--r--clang/test/Sema/c2x-nodiscard.c2
-rw-r--r--clang/test/Sema/dllexport.c12
-rw-r--r--clang/test/Sema/dllimport.c12
-rw-r--r--clang/test/Sema/internal_linkage.c2
-rw-r--r--clang/test/Sema/nonnull.c2
-rw-r--r--clang/test/Sema/pragma-ms_struct.c4
-rw-r--r--clang/test/Sema/types.c2
-rw-r--r--clang/test/Sema/unused-expr.c2
-rw-r--r--clang/test/Sema/warn-thread-safety-analysis.c2
-rw-r--r--clang/test/Sema/xray-always-instrument-attr.c2
-rw-r--r--clang/test/Sema/xray-always-instrument-attr.cpp2
-rw-r--r--clang/test/Sema/xray-log-args-oob.c2
-rw-r--r--clang/test/Sema/xray-log-args-oob.cpp2
-rw-r--r--clang/test/SemaCUDA/launch_bounds.cu2
-rw-r--r--clang/test/SemaCXX/attr-lto-visibility-public.cpp10
-rw-r--r--clang/test/SemaCXX/attr-mode-tmpl.cpp2
-rw-r--r--clang/test/SemaCXX/attr-require-constant-initialization.cpp8
-rw-r--r--clang/test/SemaCXX/attr-weak.cpp2
-rw-r--r--clang/test/SemaCXX/builtin-assume-aligned-tmpl.cpp2
-rw-r--r--clang/test/SemaCXX/dllexport.cpp16
-rw-r--r--clang/test/SemaCXX/dllimport.cpp16
-rw-r--r--clang/test/SemaCXX/internal_linkage.cpp8
-rw-r--r--clang/test/SemaCXX/warn-consumed-parsing.cpp12
-rw-r--r--clang/test/SemaCXX/warn-thread-safety-analysis.cpp8
-rw-r--r--clang/test/SemaCXX/warn-thread-safety-parsing.cpp72
-rw-r--r--clang/test/SemaCXX/warn-unused-attribute.cpp2
-rw-r--r--clang/test/SemaObjC/arc-property-lifetime.m2
-rw-r--r--clang/test/SemaObjC/dllexport.m12
-rw-r--r--clang/test/SemaObjC/dllimport.m12
-rw-r--r--clang/test/SemaObjC/format-arg-attribute.m6
-rw-r--r--clang/test/SemaObjC/objc-asm-attribute-neg-test.m6
-rw-r--r--clang/test/SemaObjC/objcbridge-attribute-arc.m2
-rw-r--r--clang/test/SemaObjC/objcbridge-attribute.m2
48 files changed, 150 insertions, 150 deletions
diff --git a/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp b/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp
index 9f7ef3ace9c..6cf27af3230 100644
--- a/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp
+++ b/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.depend/p1.cpp
@@ -7,8 +7,8 @@
[[carries_dependency]] void f1(); // FIXME: warn here
[[carries_dependency]] int f2(); // ok
int f3(int param [[carries_dependency]]); // ok
-[[carries_dependency]] int (*f4)(); // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}
-int (*f5 [[carries_dependency]])(); // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}
+[[carries_dependency]] int (*f4)(); // expected-error {{'carries_dependency' attribute only applies to parameters, Objective-C methods, and functions}}
+int (*f5 [[carries_dependency]])(); // expected-error {{'carries_dependency' attribute only applies to}}
int (*f6)() [[carries_dependency]]; // expected-error {{'carries_dependency' attribute cannot be applied to types}}
int (*f7)(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}}
int (((f8)))(int n [[carries_dependency]]); // ok
@@ -21,7 +21,7 @@ struct S {
};
void f() {
[[carries_dependency]] int f(int n [[carries_dependency]]); // ok
- [[carries_dependency]] // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}
+ [[carries_dependency]] // expected-error {{'carries_dependency' attribute only applies to}}
int (*p)(int n [[carries_dependency]]); // expected-error {{'[[carries_dependency]]' attribute only allowed on parameter in a function declaration}}
}
diff --git a/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp b/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp
index e7a23824129..4425416650e 100644
--- a/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp
+++ b/clang/test/CXX/dcl.dcl/dcl.attr/dcl.attr.nodiscard/p1.cpp
@@ -7,4 +7,4 @@ struct [[nodiscard("Wrong")]] S3 {}; // expected-error {{'nodiscard' cannot have
[[nodiscard]] int f();
enum [[nodiscard]] E {};
-namespace [[nodiscard]] N {} // expected-warning {{'nodiscard' attribute only applies to functions, methods, enums, and classes}}
+namespace [[nodiscard]] N {} // expected-warning {{'nodiscard' attribute only applies to Objective-C methods, enums, structs, unions, classes, functions, and function pointers}}
diff --git a/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m b/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m
index e9bef4cdb76..de809d8a048 100644
--- a/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m
+++ b/clang/test/CodeGenObjC/objc-asm-attribute-neg-test.m
@@ -7,15 +7,15 @@ __attribute__((objc_runtime_name("MySecretNamespace.Protocol")))
__attribute__((objc_runtime_name("MySecretNamespace.Message")))
@interface Message <Protocol> {
-__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
+__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
id MyIVAR;
}
__attribute__((objc_runtime_name("MySecretNamespace.Message")))
@property int MyProperty; // expected-error {{prefix attribute must be followed by an interface or protocol}}}}
-- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
+- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
-- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
+- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
@end
diff --git a/clang/test/Misc/pragma-attribute-supported-attributes-list.test b/clang/test/Misc/pragma-attribute-supported-attributes-list.test
index fcc2c5c2f8d..1171a2d3709 100644
--- a/clang/test/Misc/pragma-attribute-supported-attributes-list.test
+++ b/clang/test/Misc/pragma-attribute-supported-attributes-list.test
@@ -67,5 +67,5 @@
// CHECK-NEXT: Target (SubjectMatchRule_function)
// CHECK-NEXT: TestTypestate (SubjectMatchRule_function_is_member)
// CHECK-NEXT: WarnUnusedResult (SubjectMatchRule_objc_method, SubjectMatchRule_enum, SubjectMatchRule_record, SubjectMatchRule_hasType_functionType)
-// CHECK-NEXT: XRayInstrument (SubjectMatchRule_function_is_member, SubjectMatchRule_objc_method, SubjectMatchRule_function)
-// CHECK-NEXT: XRayLogArgs (SubjectMatchRule_function_is_member, SubjectMatchRule_objc_method, SubjectMatchRule_function)
+// CHECK-NEXT: XRayInstrument (SubjectMatchRule_function, SubjectMatchRule_objc_method)
+// CHECK-NEXT: XRayLogArgs (SubjectMatchRule_function, SubjectMatchRule_objc_method)
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp
index c796eded1f0..21635f0ee12 100644
--- a/clang/test/Parser/MicrosoftExtensions.cpp
+++ b/clang/test/Parser/MicrosoftExtensions.cpp
@@ -51,7 +51,7 @@ struct __declspec(uuid("0000000-0000-0000-Z234-000000000047")) uuid_attr_bad4 {
struct __declspec(uuid("000000000000-0000-1234-000000000047")) uuid_attr_bad5 { };// expected-error {{uuid attribute contains a malformed GUID}}
[uuid("000000000000-0000-1234-000000000047")] struct uuid_attr_bad6 { };// expected-error {{uuid attribute contains a malformed GUID}}
-__declspec(uuid("000000A0-0000-0000-C000-000000000046")) int i; // expected-warning {{'uuid' attribute only applies to classes}}
+__declspec(uuid("000000A0-0000-0000-C000-000000000046")) int i; // expected-warning {{'uuid' attribute only applies to structs, unions, classes, and enums}}
struct __declspec(uuid("000000A0-0000-0000-C000-000000000046"))
struct_with_uuid { };
@@ -69,7 +69,7 @@ enum __declspec(uuid("000000A0-0000-0000-C000-000000000046"))
enum_with_uuid { };
enum enum_without_uuid { };
-int __declspec(uuid("000000A0-0000-0000-C000-000000000046")) inappropriate_uuid; // expected-warning {{'uuid' attribute only applies to classes and enumerations}}
+int __declspec(uuid("000000A0-0000-0000-C000-000000000046")) inappropriate_uuid; // expected-warning {{'uuid' attribute only applies to}}
int uuid_sema_test()
{
diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp
index a803085cd31..4e3a2e4685e 100644
--- a/clang/test/Parser/cxx0x-attributes.cpp
+++ b/clang/test/Parser/cxx0x-attributes.cpp
@@ -307,7 +307,7 @@ int v5()[[gnu::unused]]; // expected-warning {{attribute 'unused' ignored}}
[[attribute_declaration]]; // expected-warning {{unknown attribute 'attribute_declaration' ignored}}
[[noreturn]]; // expected-error {{'noreturn' attribute only applies to functions}}
-[[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}
+[[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to parameters, Objective-C methods, and functions}}
class A {
A([[gnu::unused]] int a);
diff --git a/clang/test/Parser/ms-square-bracket-attributes.mm b/clang/test/Parser/ms-square-bracket-attributes.mm
index a158cf7b2b9..c1fc14cec56 100644
--- a/clang/test/Parser/ms-square-bracket-attributes.mm
+++ b/clang/test/Parser/ms-square-bracket-attributes.mm
@@ -133,7 +133,7 @@ void use_it() {
(void)__uuidof(OuterClass::sic);
}
-// expected-warning@+1 {{'uuid' attribute only applies to classes}}
+// expected-warning@+1 {{'uuid' attribute only applies to structs, unions, classes, and enums}}
[uuid("000000A0-0000-0000-C000-000000000049")] void f();
}
diff --git a/clang/test/Sema/attr-capabilities.c b/clang/test/Sema/attr-capabilities.c
index 88fdf306ac5..21cbae9e609 100644
--- a/clang/test/Sema/attr-capabilities.c
+++ b/clang/test/Sema/attr-capabilities.c
@@ -11,8 +11,8 @@ typedef union { int a; char* b; } __attribute__((capability("mutex"))) MutexUnio
// Test an invalid capability name
struct __attribute__((capability("wrong"))) IncorrectName {}; // expected-warning {{invalid capability name 'wrong'; capability name must be 'mutex' or 'role'}}
-int Test1 __attribute__((capability("test1"))); // expected-error {{'capability' attribute only applies to structs, unions, and typedefs}}
-int Test2 __attribute__((shared_capability("test2"))); // expected-error {{'shared_capability' attribute only applies to structs, unions, and typedefs}}
+int Test1 __attribute__((capability("test1"))); // expected-error {{'capability' attribute only applies to structs, unions, classes, and typedefs}}
+int Test2 __attribute__((shared_capability("test2"))); // expected-error {{'shared_capability' attribute only applies to structs, unions, classes, and typedefs}}
int Test3 __attribute__((acquire_capability("test3"))); // expected-warning {{'acquire_capability' attribute only applies to functions}}
int Test4 __attribute__((try_acquire_capability("test4"))); // expected-error {{'try_acquire_capability' attribute only applies to functions}}
int Test5 __attribute__((release_capability("test5"))); // expected-warning {{'release_capability' attribute only applies to functions}}
diff --git a/clang/test/Sema/attr-disable-tail-calls.c b/clang/test/Sema/attr-disable-tail-calls.c
index 4574d5e0b66..e8f5bcc73ee 100644
--- a/clang/test/Sema/attr-disable-tail-calls.c
+++ b/clang/test/Sema/attr-disable-tail-calls.c
@@ -8,6 +8,6 @@ void __attribute__((naked,disable_tail_calls)) foo2(int a) { // expected-error {
__asm__("");
}
-int g0 __attribute__((disable_tail_calls)); // expected-warning {{'disable_tail_calls' attribute only applies to functions and methods}}
+int g0 __attribute__((disable_tail_calls)); // expected-warning {{'disable_tail_calls' attribute only applies to functions and Objective-C methods}}
int foo3(int a) __attribute__((disable_tail_calls("abc"))); // expected-error {{'disable_tail_calls' attribute takes no arguments}}
diff --git a/clang/test/Sema/attr-minsize.c b/clang/test/Sema/attr-minsize.c
index 7b1c6ae66f1..d2374b6113b 100644
--- a/clang/test/Sema/attr-minsize.c
+++ b/clang/test/Sema/attr-minsize.c
@@ -2,4 +2,4 @@
int foo() __attribute__((__minsize__));
-int var1 __attribute__((__minsize__)); // expected-error{{'__minsize__' attribute only applies to functions and methods}}
+int var1 __attribute__((__minsize__)); // expected-error{{'__minsize__' attribute only applies to functions and Objective-C methods}}
diff --git a/clang/test/Sema/attr-mode.c b/clang/test/Sema/attr-mode.c
index e160d8d4846..c0e0426e009 100644
--- a/clang/test/Sema/attr-mode.c
+++ b/clang/test/Sema/attr-mode.c
@@ -26,8 +26,8 @@ typedef unsigned unwind_word __attribute((mode(unwind_word)));
int **__attribute((mode(QI)))* i32; // expected-error{{mode attribute}}
-__attribute__((mode(QI))) int invalid_func() { return 1; } // expected-error{{'mode' attribute only applies to variables, enums, fields and typedefs}}
-enum invalid_enum { A1 __attribute__((mode(QI))) }; // expected-error{{'mode' attribute only applies to variables, enums, fields and typedefs}}
+__attribute__((mode(QI))) int invalid_func() { return 1; } // expected-error{{'mode' attribute only applies to variables, enums, typedefs, and non-static data members}}
+enum invalid_enum { A1 __attribute__((mode(QI))) }; // expected-error{{'mode' attribute only applies to}}
typedef _Complex double c32 __attribute((mode(SC)));
int c32_test[sizeof(c32) == 8 ? 1 : -1];
diff --git a/clang/test/Sema/attr-nodebug.c b/clang/test/Sema/attr-nodebug.c
index e7ca58d3ba1..64383e0f837 100644
--- a/clang/test/Sema/attr-nodebug.c
+++ b/clang/test/Sema/attr-nodebug.c
@@ -2,7 +2,7 @@
int a __attribute__((nodebug));
-void b(int p __attribute__((nodebug))) { // expected-warning {{'nodebug' attribute only applies to variables and functions}}
+void b(int p __attribute__((nodebug))) { // expected-warning {{'nodebug' attribute only applies to functions, function pointers, Objective-C methods, and variables and functions}}
int b __attribute__((nodebug));
}
diff --git a/clang/test/Sema/attr-section.c b/clang/test/Sema/attr-section.c
index b361738e8e2..bc424741113 100644
--- a/clang/test/Sema/attr-section.c
+++ b/clang/test/Sema/attr-section.c
@@ -10,7 +10,7 @@ int y __attribute__((section(
// PR6007
void test() {
- __attribute__((section("NEAR,x"))) int n1; // expected-error {{'section' attribute only applies to functions, methods, properties, and global variables}}
+ __attribute__((section("NEAR,x"))) int n1; // expected-error {{'section' attribute only applies to functions, global variables, Objective-C methods, and Objective-C properties}}
__attribute__((section("NEAR,x"))) static int n2; // ok.
}
@@ -18,7 +18,7 @@ void test() {
void __attribute__((section("foo,zed"))) test2(void); // expected-note {{previous attribute is here}}
void __attribute__((section("bar,zed"))) test2(void) {} // expected-warning {{section does not match previous declaration}}
-enum __attribute__((section("NEAR,x"))) e { one }; // expected-error {{'section' attribute only applies to functions, methods, properties, and global variables}}
+enum __attribute__((section("NEAR,x"))) e { one }; // expected-error {{'section' attribute only applies to}}
extern int a; // expected-note {{previous declaration is here}}
int *b = &a;
diff --git a/clang/test/Sema/attr-weak.c b/clang/test/Sema/attr-weak.c
index df74554487e..e3610caba58 100644
--- a/clang/test/Sema/attr-weak.c
+++ b/clang/test/Sema/attr-weak.c
@@ -5,10 +5,10 @@ extern int g1 __attribute__((weak_import));
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
-void __attribute__((weak_import)) g5(void) {
+void __attribute__((weak_import)) g5(void) {
}
-struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables and functions}}
+struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}
static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
diff --git a/clang/test/Sema/builtin-assume-aligned.c b/clang/test/Sema/builtin-assume-aligned.c
index 33c1b74488e..057a500b321 100644
--- a/clang/test/Sema/builtin-assume-aligned.c
+++ b/clang/test/Sema/builtin-assume-aligned.c
@@ -47,7 +47,7 @@ void test_void_assume_aligned(void) __attribute__((assume_aligned(32))); // expe
int test_int_assume_aligned(void) __attribute__((assume_aligned(16))); // expected-warning {{'assume_aligned' attribute only applies to return values that are pointers}}
void *test_ptr_assume_aligned(void) __attribute__((assume_aligned(64))); // no-warning
-int j __attribute__((assume_aligned(8))); // expected-warning {{'assume_aligned' attribute only applies to functions and methods}}
+int j __attribute__((assume_aligned(8))); // expected-warning {{'assume_aligned' attribute only applies to Objective-C methods and functions}}
void *test_no_fn_proto() __attribute__((assume_aligned(32))); // no-warning
void *test_with_fn_proto(void) __attribute__((assume_aligned(128))); // no-warning
diff --git a/clang/test/Sema/c2x-nodiscard.c b/clang/test/Sema/c2x-nodiscard.c
index f128d3bb572..fc5b12347e6 100644
--- a/clang/test/Sema/c2x-nodiscard.c
+++ b/clang/test/Sema/c2x-nodiscard.c
@@ -13,7 +13,7 @@ struct [[nodiscard("Wrong")]] S3 { // expected-error {{'nodiscard' cannot have a
[[nodiscard]] int f1(void);
enum [[nodiscard]] E1 { One };
-[[nodiscard]] int i; // expected-warning {{'nodiscard' attribute only applies to functions, methods, enums, and classes}}
+[[nodiscard]] int i; // expected-warning {{'nodiscard' attribute only applies to Objective-C methods, enums, structs, unions, classes, functions, and function pointers}}
struct [[nodiscard]] S4 {
int i;
diff --git a/clang/test/Sema/dllexport.c b/clang/test/Sema/dllexport.c
index 7991a455b4d..2e0fe0ce114 100644
--- a/clang/test/Sema/dllexport.c
+++ b/clang/test/Sema/dllexport.c
@@ -5,17 +5,17 @@
// Invalid usage.
__declspec(dllexport) typedef int typedef1;
-// expected-warning@-1{{'dllexport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, classes, and Objective-C interfaces}}
typedef __declspec(dllexport) int typedef2;
-// expected-warning@-1{{'dllexport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
typedef int __declspec(dllexport) typedef3;
-// expected-warning@-1{{'dllexport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
typedef __declspec(dllexport) void (*FunTy)();
-// expected-warning@-1{{'dllexport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
enum __declspec(dllexport) Enum { EnumVal };
-// expected-warning@-1{{'dllexport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
struct __declspec(dllexport) Record {};
-// expected-warning@-1{{'dllexport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
diff --git a/clang/test/Sema/dllimport.c b/clang/test/Sema/dllimport.c
index 53bf372c654..988a8e33a7e 100644
--- a/clang/test/Sema/dllimport.c
+++ b/clang/test/Sema/dllimport.c
@@ -6,17 +6,17 @@
// Invalid usage.
__declspec(dllimport) typedef int typedef1;
-// expected-warning@-1{{'dllimport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, classes, and Objective-C interfaces}}
typedef __declspec(dllimport) int typedef2;
-// expected-warning@-1{{'dllimport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
typedef int __declspec(dllimport) typedef3;
-// expected-warning@-1{{'dllimport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
typedef __declspec(dllimport) void (*FunTy)();
-// expected-warning@-1{{'dllimport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
enum __declspec(dllimport) Enum { EnumVal };
-// expected-warning@-1{{'dllimport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
struct __declspec(dllimport) Record {};
-// expected-warning@-1{{'dllimport' attribute only applies to variables and functions}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
diff --git a/clang/test/Sema/internal_linkage.c b/clang/test/Sema/internal_linkage.c
index f4deccca63d..37090a33331 100644
--- a/clang/test/Sema/internal_linkage.c
+++ b/clang/test/Sema/internal_linkage.c
@@ -15,7 +15,7 @@ int var5 __attribute__((internal_linkage)); // expected-error{{'internal_linkage
int var5 __attribute__((common)); // expected-note{{conflicting attribute is here}}
__attribute__((internal_linkage)) int f() {}
-struct __attribute__((internal_linkage)) S { // expected-warning{{'internal_linkage' attribute only applies to variables and functions}}
+struct __attribute__((internal_linkage)) S { // expected-warning{{'internal_linkage' attribute only applies to variables, functions, and classes}}
};
__attribute__((internal_linkage("foo"))) int g() {} // expected-error{{'internal_linkage' attribute takes no arguments}}
diff --git a/clang/test/Sema/nonnull.c b/clang/test/Sema/nonnull.c
index 217bbb16df6..b589bb3d1ff 100644
--- a/clang/test/Sema/nonnull.c
+++ b/clang/test/Sema/nonnull.c
@@ -37,7 +37,7 @@ int test_int_returns_nonnull(void) __attribute__((returns_nonnull)); // expected
void *test_ptr_returns_nonnull(void) __attribute__((returns_nonnull)); // no-warning
int i __attribute__((nonnull)); // expected-warning {{'nonnull' attribute only applies to functions, methods, and parameters}}
-int j __attribute__((returns_nonnull)); // expected-warning {{'returns_nonnull' attribute only applies to functions and methods}}
+int j __attribute__((returns_nonnull)); // expected-warning {{'returns_nonnull' attribute only applies to Objective-C methods and functions}}
void *test_no_fn_proto() __attribute__((returns_nonnull)); // no-warning
void *test_with_fn_proto(void) __attribute__((returns_nonnull)); // no-warning
diff --git a/clang/test/Sema/pragma-ms_struct.c b/clang/test/Sema/pragma-ms_struct.c
index a2591b6a4c4..e10d49e6761 100644
--- a/clang/test/Sema/pragma-ms_struct.c
+++ b/clang/test/Sema/pragma-ms_struct.c
@@ -25,7 +25,7 @@ struct {
} __attribute__((__ms_struct__)) t1;
struct S {
- double __attribute__((ms_struct)) d; // expected-warning {{'ms_struct' attribute only applies to struct or union}}
+ double __attribute__((ms_struct)) d; // expected-warning {{'ms_struct' attribute only applies to structs, unions, and classes}}
unsigned long bf_1 : 12;
unsigned long : 0;
unsigned long bf_2 : 12;
@@ -36,7 +36,7 @@ enum
A = 0,
B,
C
-} __attribute__((ms_struct)) e1; // expected-warning {{'ms_struct' attribute only applies to struct or union}}
+} __attribute__((ms_struct)) e1; // expected-warning {{'ms_struct' attribute only applies to}}
// rdar://10513599
#pragma ms_struct on
diff --git a/clang/test/Sema/types.c b/clang/test/Sema/types.c
index 9981be50ad4..f44057dc402 100644
--- a/clang/test/Sema/types.c
+++ b/clang/test/Sema/types.c
@@ -75,7 +75,7 @@ typedef int __attribute__ ((ext_vector_type(8192))) x2; // expected-error {{vect
// no support for vector enum type
enum { e_2 } x3 __attribute__((vector_size(64))); // expected-error {{invalid vector element type}}
-int x4 __attribute__((ext_vector_type(64))); // expected-error {{'ext_vector_type' attribute only applies to types}}
+int x4 __attribute__((ext_vector_type(64))); // expected-error {{'ext_vector_type' attribute only applies to typedefs}}
// rdar://16492792
typedef __attribute__ ((ext_vector_type(32),__aligned__(32))) unsigned char uchar32;
diff --git a/clang/test/Sema/unused-expr.c b/clang/test/Sema/unused-expr.c
index 58ad8278f20..c574f5e4afe 100644
--- a/clang/test/Sema/unused-expr.c
+++ b/clang/test/Sema/unused-expr.c
@@ -96,7 +96,7 @@ int t6() {
return 0;
}
-int t7 __attribute__ ((warn_unused_result)); // expected-warning {{'warn_unused_result' attribute only applies to functions}}
+int t7 __attribute__ ((warn_unused_result)); // expected-warning {{'warn_unused_result' attribute only applies to Objective-C methods, enums, structs, unions, classes, functions, and function pointers}}
// PR4010
int (*fn4)(void) __attribute__ ((warn_unused_result));
diff --git a/clang/test/Sema/warn-thread-safety-analysis.c b/clang/test/Sema/warn-thread-safety-analysis.c
index 425ce4c196a..0a375b873e6 100644
--- a/clang/test/Sema/warn-thread-safety-analysis.c
+++ b/clang/test/Sema/warn-thread-safety-analysis.c
@@ -130,4 +130,4 @@ int main() {
// We had a problem where we'd skip all attributes that follow a late-parsed
// attribute in a single __attribute__.
-void run() __attribute__((guarded_by(mu1), guarded_by(mu1))); // expected-warning 2{{only applies to fields and global variables}}
+void run() __attribute__((guarded_by(mu1), guarded_by(mu1))); // expected-warning 2{{only applies to non-static data members and global variables}}
diff --git a/clang/test/Sema/xray-always-instrument-attr.c b/clang/test/Sema/xray-always-instrument-attr.c
index 3c063e21a68..b5236901028 100644
--- a/clang/test/Sema/xray-always-instrument-attr.c
+++ b/clang/test/Sema/xray-always-instrument-attr.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c11
void foo() __attribute__((xray_always_instrument));
-struct __attribute__((xray_always_instrument)) a { int x; }; // expected-warning {{'xray_always_instrument' attribute only applies to functions and methods}}
+struct __attribute__((xray_always_instrument)) a { int x; }; // expected-warning {{'xray_always_instrument' attribute only applies to functions and Objective-C methods}}
void bar() __attribute__((xray_always_instrument("not-supported"))); // expected-error {{'xray_always_instrument' attribute takes no arguments}}
diff --git a/clang/test/Sema/xray-always-instrument-attr.cpp b/clang/test/Sema/xray-always-instrument-attr.cpp
index 8d42837ec6b..d6a33955cd7 100644
--- a/clang/test/Sema/xray-always-instrument-attr.cpp
+++ b/clang/test/Sema/xray-always-instrument-attr.cpp
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c++11 -x c++
void foo [[clang::xray_always_instrument]] ();
-struct [[clang::xray_always_instrument]] a { int x; }; // expected-warning {{'xray_always_instrument' attribute only applies to functions and methods}}
+struct [[clang::xray_always_instrument]] a { int x; }; // expected-warning {{'xray_always_instrument' attribute only applies to functions and Objective-C methods}}
class b {
void c [[clang::xray_always_instrument]] ();
diff --git a/clang/test/Sema/xray-log-args-oob.c b/clang/test/Sema/xray-log-args-oob.c
index a6be0f81cb4..585f5fd172e 100644
--- a/clang/test/Sema/xray-log-args-oob.c
+++ b/clang/test/Sema/xray-log-args-oob.c
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c11
void foo(int) __attribute__((xray_log_args(1)));
-struct __attribute__((xray_log_args(1))) a { int x; }; // expected-warning {{'xray_log_args' attribute only applies to functions and methods}}
+struct __attribute__((xray_log_args(1))) a { int x; }; // expected-warning {{'xray_log_args' attribute only applies to functions and Objective-C methods}}
void fop() __attribute__((xray_log_args(1))); // expected-error {{'xray_log_args' attribute parameter 1 is out of bounds}}
diff --git a/clang/test/Sema/xray-log-args-oob.cpp b/clang/test/Sema/xray-log-args-oob.cpp
index 414bce0c334..82f3be30c6d 100644
--- a/clang/test/Sema/xray-log-args-oob.cpp
+++ b/clang/test/Sema/xray-log-args-oob.cpp
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -verify -fsyntax-only -std=c++11 -x c++
void foo [[clang::xray_log_args(1)]] (int);
-struct [[clang::xray_log_args(1)]] a { int x; }; // expected-warning {{'xray_log_args' attribute only applies to functions and methods}}
+struct [[clang::xray_log_args(1)]] a { int x; }; // expected-warning {{'xray_log_args' attribute only applies to functions and Objective-C methods}}
void fop [[clang::xray_log_args(1)]] (); // expected-error {{'xray_log_args' attribute parameter 1 is out of bounds}}
diff --git a/clang/test/SemaCUDA/launch_bounds.cu b/clang/test/SemaCUDA/launch_bounds.cu
index 468954a3aab..0ca0c0145d8 100644
--- a/clang/test/SemaCUDA/launch_bounds.cu
+++ b/clang/test/SemaCUDA/launch_bounds.cu
@@ -15,7 +15,7 @@ __launch_bounds__(128, -7) void TestNegArg2(void); // expected-warning {{'launch
__launch_bounds__(1, 2, 3) void Test3Args(void); // expected-error {{'launch_bounds' attribute takes no more than 2 arguments}}
__launch_bounds__() void TestNoArgs(void); // expected-error {{'launch_bounds' attribute takes at least 1 argument}}
-int TestNoFunction __launch_bounds__(128, 7); // expected-warning {{'launch_bounds' attribute only applies to functions and methods}}
+int TestNoFunction __launch_bounds__(128, 7); // expected-warning {{'launch_bounds' attribute only applies to Objective-C methods, functions, and function pointers}}
__launch_bounds__(true) void TestBool(void);
__launch_bounds__(128.0) void TestFP(void); // expected-error {{'launch_bounds' attribute requires parameter 0 to be an integer constant}}
diff --git a/clang/test/SemaCXX/attr-lto-visibility-public.cpp b/clang/test/SemaCXX/attr-lto-visibility-public.cpp
index 2f9ed87f6ee..42e0f79279d 100644
--- a/clang/test/SemaCXX/attr-lto-visibility-public.cpp
+++ b/clang/test/SemaCXX/attr-lto-visibility-public.cpp
@@ -1,13 +1,13 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
-int i [[clang::lto_visibility_public]]; // expected-warning {{'lto_visibility_public' attribute only applies to struct, union or class}}
-typedef int t [[clang::lto_visibility_public]]; // expected-warning {{'lto_visibility_public' attribute only applies to struct, union or class}}
-[[clang::lto_visibility_public]] void f(); // expected-warning {{'lto_visibility_public' attribute only applies to struct, union or class}}
+int i [[clang::lto_visibility_public]]; // expected-warning {{'lto_visibility_public' attribute only applies to structs, unions, and classes}}
+typedef int t [[clang::lto_visibility_public]]; // expected-warning {{'lto_visibility_public' attribute only applies to}}
+[[clang::lto_visibility_public]] void f(); // expected-warning {{'lto_visibility_public' attribute only applies to}}
void f() [[clang::lto_visibility_public]]; // expected-error {{'lto_visibility_public' attribute cannot be applied to types}}
struct [[clang::lto_visibility_public]] s1 {
- int i [[clang::lto_visibility_public]]; // expected-warning {{'lto_visibility_public' attribute only applies to struct, union or class}}
- [[clang::lto_visibility_public]] void f(); // expected-warning {{'lto_visibility_public' attribute only applies to struct, union or class}}
+ int i [[clang::lto_visibility_public]]; // expected-warning {{'lto_visibility_public' attribute only applies to}}
+ [[clang::lto_visibility_public]] void f(); // expected-warning {{'lto_visibility_public' attribute only applies to}}
};
struct [[clang::lto_visibility_public(1)]] s2 { // expected-error {{'lto_visibility_public' attribute takes no arguments}}
diff --git a/clang/test/SemaCXX/attr-mode-tmpl.cpp b/clang/test/SemaCXX/attr-mode-tmpl.cpp
index d83bb398905..f665b1ba491 100644
--- a/clang/test/SemaCXX/attr-mode-tmpl.cpp
+++ b/clang/test/SemaCXX/attr-mode-tmpl.cpp
@@ -72,7 +72,7 @@ struct TemplatedStruct {
// expected-warning@-1{{deprecated}}
// Check attribute on methods - it is invalid.
- __attribute__((mode(QI))) T g1() { return 0; } // expected-error{{'mode' attribute only applies to variables, enums, fields and typedefs}}
+ __attribute__((mode(QI))) T g1() { return 0; } // expected-error{{'mode' attribute only applies to variables, enums, typedefs, and non-static data members}}
};
diff --git a/clang/test/SemaCXX/attr-require-constant-initialization.cpp b/clang/test/SemaCXX/attr-require-constant-initialization.cpp
index 0df9f2e8802..2dd72ea6dba 100644
--- a/clang/test/SemaCXX/attr-require-constant-initialization.cpp
+++ b/clang/test/SemaCXX/attr-require-constant-initialization.cpp
@@ -56,12 +56,12 @@ struct StoresNonLit {
#if defined(TEST_ONE) // Test semantics of attribute
// Test diagnostics when attribute is applied to non-static declarations.
-void test_func_local(ATTR int param) { // expected-error {{only applies to variables with static or thread}}
- ATTR int x = 42; // expected-error {{only applies to variables with static or thread}}
+void test_func_local(ATTR int param) { // expected-error {{only applies to global variables}}
+ ATTR int x = 42; // expected-error {{only applies to}}
ATTR extern int y;
}
-struct ATTR class_mem { // expected-error {{only applies to variables with static or thread}}
- ATTR int x; // expected-error {{only applies to variables with static or thread}}
+struct ATTR class_mem { // expected-error {{only applies to}}
+ ATTR int x; // expected-error {{only applies to}}
};
// [basic.start.static]p2.1
diff --git a/clang/test/SemaCXX/attr-weak.cpp b/clang/test/SemaCXX/attr-weak.cpp
index 8ba3a954282..51deb664ce6 100644
--- a/clang/test/SemaCXX/attr-weak.cpp
+++ b/clang/test/SemaCXX/attr-weak.cpp
@@ -3,7 +3,7 @@
static int test0 __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
static void test1() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
-namespace test2 __attribute__((weak)) { // expected-warning {{'weak' attribute only applies to variables, functions and classes}}
+namespace test2 __attribute__((weak)) { // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
}
namespace {
diff --git a/clang/test/SemaCXX/builtin-assume-aligned-tmpl.cpp b/clang/test/SemaCXX/builtin-assume-aligned-tmpl.cpp
index 0909070c5e1..61b85557d6b 100644
--- a/clang/test/SemaCXX/builtin-assume-aligned-tmpl.cpp
+++ b/clang/test/SemaCXX/builtin-assume-aligned-tmpl.cpp
@@ -57,7 +57,7 @@ void test22() {
atest4<int, 5>();
}
-// expected-warning@+1 {{'assume_aligned' attribute only applies to functions and methods}}
+// expected-warning@+1 {{'assume_aligned' attribute only applies to Objective-C methods and functions}}
class __attribute__((assume_aligned(32))) x {
int y;
};
diff --git a/clang/test/SemaCXX/dllexport.cpp b/clang/test/SemaCXX/dllexport.cpp
index a3fed70ec95..c09a531c19b 100644
--- a/clang/test/SemaCXX/dllexport.cpp
+++ b/clang/test/SemaCXX/dllexport.cpp
@@ -17,18 +17,18 @@ struct External { int v; };
// Invalid usage.
__declspec(dllexport) typedef int typedef1;
-// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, classes, and Objective-C interfaces}}
typedef __declspec(dllexport) int typedef2;
-// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
typedef int __declspec(dllexport) typedef3;
-// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
typedef __declspec(dllexport) void (*FunTy)();
-// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
enum __declspec(dllexport) Enum {};
-// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
#if __has_feature(cxx_strong_enums)
enum class __declspec(dllexport) EnumClass {};
-// expected-warning@-1{{'dllexport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
#endif
@@ -565,7 +565,7 @@ private:
__declspec(dllexport) void privateDef();
public:
- __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to variables, functions and classes}}
+ __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to}}
__declspec(dllexport) static int StaticField;
__declspec(dllexport) static int StaticFieldDef;
__declspec(dllexport) static const int StaticConstField;
@@ -977,7 +977,7 @@ private:
__declspec(dllexport) void privateDef();
public:
- __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to variables, functions and classes}}
+ __declspec(dllexport) int Field; // expected-warning{{'dllexport' attribute only applies to}}
__declspec(dllexport) static int StaticField;
__declspec(dllexport) static int StaticFieldDef;
__declspec(dllexport) static const int StaticConstField;
diff --git a/clang/test/SemaCXX/dllimport.cpp b/clang/test/SemaCXX/dllimport.cpp
index 1c59ccad6e1..04c33e9fb5c 100644
--- a/clang/test/SemaCXX/dllimport.cpp
+++ b/clang/test/SemaCXX/dllimport.cpp
@@ -16,18 +16,18 @@ namespace { struct Internal {}; }
// Invalid usage.
__declspec(dllimport) typedef int typedef1;
-// expected-warning@-1{{'dllimport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, classes, and Objective-C interfaces}}
typedef __declspec(dllimport) int typedef2;
-// expected-warning@-1{{'dllimport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
typedef int __declspec(dllimport) typedef3;
-// expected-warning@-1{{'dllimport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
typedef __declspec(dllimport) void (*FunTy)();
-// expected-warning@-1{{'dllimport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
enum __declspec(dllimport) Enum {};
-// expected-warning@-1{{'dllimport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
#if __has_feature(cxx_strong_enums)
enum class __declspec(dllimport) EnumClass {};
-// expected-warning@-1{{'dllimport' attribute only applies to variables, functions and classes}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
#endif
@@ -574,7 +574,7 @@ private:
__declspec(dllimport) void privateDecl();
public:
- __declspec(dllimport) int Field; // expected-warning{{'dllimport' attribute only applies to variables, functions and classes}}
+ __declspec(dllimport) int Field; // expected-warning{{'dllimport' attribute only applies to}}
__declspec(dllimport) static int StaticField;
__declspec(dllimport) static int StaticFieldDef; // expected-note{{attribute is here}}
__declspec(dllimport) static const int StaticConstField;
@@ -1147,7 +1147,7 @@ private:
__declspec(dllimport) void privateDecl();
public:
- __declspec(dllimport) int Field; // expected-warning{{'dllimport' attribute only applies to variables, functions and classes}}
+ __declspec(dllimport) int Field; // expected-warning{{'dllimport' attribute only applies to}}
__declspec(dllimport) static int StaticField;
__declspec(dllimport) static int StaticFieldDef; // expected-note{{attribute is here}}
__declspec(dllimport) static const int StaticConstField;
diff --git a/clang/test/SemaCXX/internal_linkage.cpp b/clang/test/SemaCXX/internal_linkage.cpp
index d5cc6767392..921a90ab4a4 100644
--- a/clang/test/SemaCXX/internal_linkage.cpp
+++ b/clang/test/SemaCXX/internal_linkage.cpp
@@ -5,7 +5,7 @@ int f() __attribute__((internal_linkage));
class A;
class __attribute__((internal_linkage)) A {
public:
- int x __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+ int x __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to variables, functions, and classes}}
static int y __attribute__((internal_linkage));
void f1() __attribute__((internal_linkage));
void f2() __attribute__((internal_linkage)) {}
@@ -16,7 +16,7 @@ public:
~A() __attribute__((internal_linkage)) {}
A& operator=(const A&) __attribute__((internal_linkage)) { return *this; }
struct {
- int z __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+ int z __attribute__((internal_linkage)); // expected-warning{{'internal_linkage' attribute only applies to}}
};
};
@@ -24,14 +24,14 @@ __attribute__((internal_linkage)) void A::f4() {} // expected-error{{'internal_l
__attribute__((internal_linkage)) int A::zz; // expected-error{{'internal_linkage' attribute does not appear on the first declaration of 'zz'}}
-namespace Z __attribute__((internal_linkage)) { // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+namespace Z __attribute__((internal_linkage)) { // expected-warning{{'internal_linkage' attribute only applies to}}
}
__attribute__((internal_linkage("foo"))) int g() {} // expected-error{{'internal_linkage' attribute takes no arguments}}
[[clang::internal_linkage]] int h() {}
-enum struct __attribute__((internal_linkage)) E { // expected-warning{{'internal_linkage' attribute only applies to variables, functions and classes}}
+enum struct __attribute__((internal_linkage)) E { // expected-warning{{'internal_linkage' attribute only applies to}}
a = 1,
b = 2
};
diff --git a/clang/test/SemaCXX/warn-consumed-parsing.cpp b/clang/test/SemaCXX/warn-consumed-parsing.cpp
index 179604141b7..722a60bf986 100644
--- a/clang/test/SemaCXX/warn-consumed-parsing.cpp
+++ b/clang/test/SemaCXX/warn-consumed-parsing.cpp
@@ -22,15 +22,15 @@ class AttrTester0 {
void callableWhen() __attribute__ ((callable_when())); // expected-error {{'callable_when' attribute takes at least 1 argument}}
};
-int var0 SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to methods}}
-int var1 TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to methods}}
-int var2 CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to methods}}
+int var0 SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to functions}}
+int var1 TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to}}
+int var2 CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to}}
int var3 CONSUMABLE(consumed); // expected-warning {{'consumable' attribute only applies to classes}}
int var4 RETURN_TYPESTATE(consumed); // expected-warning {{'return_typestate' attribute only applies to functions}}
-void function0() SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to methods}}
-void function1() TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to methods}}
-void function2() CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to methods}}
+void function0() SET_TYPESTATE(consumed); // expected-warning {{'set_typestate' attribute only applies to}}
+void function1() TEST_TYPESTATE(consumed); // expected-warning {{'test_typestate' attribute only applies to}}
+void function2() CALLABLE_WHEN("consumed"); // expected-warning {{'callable_when' attribute only applies to}}
void function3() CONSUMABLE(consumed); // expected-warning {{'consumable' attribute only applies to classes}}
class CONSUMABLE(unknown) AttrTester1 {
diff --git a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
index e6e9a0ac18f..fc1ea5e9e99 100644
--- a/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-analysis.cpp
@@ -4427,11 +4427,11 @@ namespace pt_guard_attribute_type {
int j PT_GUARDED_VAR; // expected-warning {{'pt_guarded_var' only applies to pointer types; type here is 'int'}}
void test() {
- int i PT_GUARDED_BY(sls_mu); // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
- int j PT_GUARDED_VAR; // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
+ int i PT_GUARDED_BY(sls_mu); // expected-warning {{'pt_guarded_by' attribute only applies to non-static data members and global variables}}
+ int j PT_GUARDED_VAR; // expected-warning {{'pt_guarded_var' attribute only applies to non-static data members and global variables}}
- typedef int PT_GUARDED_BY(sls_mu) bad1; // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
- typedef int PT_GUARDED_VAR bad2; // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
+ typedef int PT_GUARDED_BY(sls_mu) bad1; // expected-warning {{'pt_guarded_by' attribute only applies to}}
+ typedef int PT_GUARDED_VAR bad2; // expected-warning {{'pt_guarded_var' attribute only applies to}}
}
} // end namespace pt_guard_attribute_type
diff --git a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
index ae32bfe9c91..b66c027e52a 100644
--- a/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-parsing.cpp
@@ -154,18 +154,18 @@ class GVFoo {
};
class GUARDED_VAR GV { // \
- // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_var' attribute only applies to non-static data members and global variables}}
};
void gv_function() GUARDED_VAR; // \
- // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_var' attribute only applies to}}
void gv_function_params(int gv_lvar GUARDED_VAR); // \
- // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_var' attribute only applies to}}
int gv_testfn(int y){
int x GUARDED_VAR = y; // \
- // expected-warning {{'guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_var' attribute only applies to}}
return x;
}
@@ -194,7 +194,7 @@ class PGVFoo {
};
class PT_GUARDED_VAR PGV { // \
- // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_var' attribute only applies to non-static data members and global variables}}
};
int *pgv_var_args __attribute__((pt_guarded_var(1))); // \
@@ -202,14 +202,14 @@ int *pgv_var_args __attribute__((pt_guarded_var(1))); // \
void pgv_function() PT_GUARDED_VAR; // \
- // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_var' attribute only applies to}}
void pgv_function_params(int *gv_lvar PT_GUARDED_VAR); // \
- // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_var' attribute only applies to}}
void pgv_testfn(int y){
int *x PT_GUARDED_VAR = new int(0); // \
- // expected-warning {{'pt_guarded_var' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_var' attribute only applies to}}
delete x;
}
@@ -231,28 +231,28 @@ class __attribute__((lockable (1))) LTestClass_args { // \
};
void l_test_function() LOCKABLE; // \
- // expected-warning {{'lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'lockable' attribute only applies to structs, unions, and classes}}
int l_testfn(int y) {
int x LOCKABLE = y; // \
- // expected-warning {{'lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'lockable' attribute only applies to}}
return x;
}
int l_test_var LOCKABLE; // \
- // expected-warning {{'lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'lockable' attribute only applies to}}
class LFoo {
private:
int test_field LOCKABLE; // \
- // expected-warning {{'lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'lockable' attribute only applies to}}
void test_method() LOCKABLE; // \
- // expected-warning {{'lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'lockable' attribute only applies to}}
};
void l_function_params(int lvar LOCKABLE); // \
- // expected-warning {{'lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'lockable' attribute only applies to}}
//-----------------------------------------//
@@ -271,28 +271,28 @@ class __attribute__((scoped_lockable (1))) SLTestClass_args { // \
};
void sl_test_function() SCOPED_LOCKABLE; // \
- // expected-warning {{'scoped_lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'scoped_lockable' attribute only applies to structs, unions, and classes}}
int sl_testfn(int y) {
int x SCOPED_LOCKABLE = y; // \
- // expected-warning {{'scoped_lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'scoped_lockable' attribute only applies to}}
return x;
}
int sl_test_var SCOPED_LOCKABLE; // \
- // expected-warning {{'scoped_lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'scoped_lockable' attribute only applies to}}
class SLFoo {
private:
int test_field SCOPED_LOCKABLE; // \
- // expected-warning {{'scoped_lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'scoped_lockable' attribute only applies to}}
void test_method() SCOPED_LOCKABLE; // \
- // expected-warning {{'scoped_lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'scoped_lockable' attribute only applies to}}
};
void sl_function_params(int lvar SCOPED_LOCKABLE); // \
- // expected-warning {{'scoped_lockable' attribute only applies to struct, union or class}}
+ // expected-warning {{'scoped_lockable' attribute only applies to}}
//-----------------------------------------//
@@ -325,18 +325,18 @@ class GBFoo {
};
class GUARDED_BY(mu1) GB { // \
- // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_by' attribute only applies to non-static data members and global variables}}
};
void gb_function() GUARDED_BY(mu1); // \
- // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_by' attribute only applies to}}
void gb_function_params(int gv_lvar GUARDED_BY(mu1)); // \
- // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_by' attribute only applies to}}
int gb_testfn(int y){
int x GUARDED_BY(mu1) = y; // \
- // expected-warning {{'guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'guarded_by' attribute only applies to}}
return x;
}
@@ -396,18 +396,18 @@ class PGBFoo {
};
class PT_GUARDED_BY(mu1) PGB { // \
- // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_by' attribute only applies to non-static data members and global variables}}
};
void pgb_function() PT_GUARDED_BY(mu1); // \
- // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_by' attribute only applies to}}
void pgb_function_params(int gv_lvar PT_GUARDED_BY(mu1)); // \
- // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_by' attribute only applies to}}
void pgb_testfn(int y){
int *x PT_GUARDED_BY(mu1) = new int(0); // \
- // expected-warning {{'pt_guarded_by' attribute only applies to fields and global variables}}
+ // expected-warning {{'pt_guarded_by' attribute only applies to}}
delete x;
}
@@ -458,18 +458,18 @@ class AAFoo {
};
class ACQUIRED_AFTER(mu1) AA { // \
- // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_after' attribute only applies to non-static data members and global variables}}
};
void aa_function() ACQUIRED_AFTER(mu1); // \
- // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_after' attribute only applies to}}
void aa_function_params(int gv_lvar ACQUIRED_AFTER(mu1)); // \
- // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_after' attribute only applies to}}
void aa_testfn(int y){
Mutex x ACQUIRED_AFTER(mu1) = Mutex(); // \
- // expected-warning {{'acquired_after' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_after' attribute only applies to}}
}
//Check argument parsing.
@@ -518,18 +518,18 @@ class ABFoo {
};
class ACQUIRED_BEFORE(mu1) AB { // \
- // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_before' attribute only applies to non-static data members and global variables}}
};
void ab_function() ACQUIRED_BEFORE(mu1); // \
- // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_before' attribute only applies to}}
void ab_function_params(int gv_lvar ACQUIRED_BEFORE(mu1)); // \
- // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_before' attribute only applies to}}
void ab_testfn(int y){
Mutex x ACQUIRED_BEFORE(mu1) = Mutex(); // \
- // expected-warning {{'acquired_before' attribute only applies to fields and global variables}}
+ // expected-warning {{'acquired_before' attribute only applies to}}
}
// Note: illegal int ab_int ACQUIRED_BEFORE(mu1) will
diff --git a/clang/test/SemaCXX/warn-unused-attribute.cpp b/clang/test/SemaCXX/warn-unused-attribute.cpp
index f52de3b931b..dffda31f464 100644
--- a/clang/test/SemaCXX/warn-unused-attribute.cpp
+++ b/clang/test/SemaCXX/warn-unused-attribute.cpp
@@ -15,6 +15,6 @@ int main(void) {
TestNormal normal;
used.use();
- int i __attribute__((warn_unused)) = 12; // expected-warning {{'warn_unused' attribute only applies to struct, union or class}}
+ int i __attribute__((warn_unused)) = 12; // expected-warning {{'warn_unused' attribute only applies to structs, unions, and classes}}
return i;
}
diff --git a/clang/test/SemaObjC/arc-property-lifetime.m b/clang/test/SemaObjC/arc-property-lifetime.m
index cfa32d1028d..b4b34036c7c 100644
--- a/clang/test/SemaObjC/arc-property-lifetime.m
+++ b/clang/test/SemaObjC/arc-property-lifetime.m
@@ -172,7 +172,7 @@ void foo(Baz *f) {
// rdar://11253688
@interface Boom
{
- const void * innerPointerIvar __attribute__((objc_returns_inner_pointer)); // expected-error {{'objc_returns_inner_pointer' attribute only applies to methods and properties}}
+ const void * innerPointerIvar __attribute__((objc_returns_inner_pointer)); // expected-error {{'objc_returns_inner_pointer' attribute only applies to Objective-C methods and Objective-C properties}}
}
@property (readonly) Boom * NotInnerPointer __attribute__((objc_returns_inner_pointer)); // expected-warning {{'objc_returns_inner_pointer' attribute only applies to properties that return a non-retainable pointer}}
- (Boom *) NotInnerPointerMethod __attribute__((objc_returns_inner_pointer)); // expected-warning {{'objc_returns_inner_pointer' attribute only applies to methods that return a non-retainable pointer}}
diff --git a/clang/test/SemaObjC/dllexport.m b/clang/test/SemaObjC/dllexport.m
index e90b982c15c..11cd1fbe14e 100644
--- a/clang/test/SemaObjC/dllexport.m
+++ b/clang/test/SemaObjC/dllexport.m
@@ -1,17 +1,17 @@
// RUN: %clang_cc1 -triple i686-windows -fdeclspec -fsyntax-only -verify %s
__declspec(dllexport) typedef int typedef1;
-// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, classes, and Objective-C interfaces}}
typedef __declspec(dllexport) int typedef2;
-// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
typedef int __declspec(dllexport) typedef3;
-// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
typedef __declspec(dllexport) void (*FunTy)();
-// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
enum __declspec(dllexport) E { Val };
-// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
struct __declspec(dllexport) Record {};
-// expected-warning@-1{{'dllexport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllexport' attribute only applies to}}
__declspec(dllexport)
__attribute__((__objc_root_class__))
diff --git a/clang/test/SemaObjC/dllimport.m b/clang/test/SemaObjC/dllimport.m
index b8360773c69..ea87aea9b8d 100644
--- a/clang/test/SemaObjC/dllimport.m
+++ b/clang/test/SemaObjC/dllimport.m
@@ -1,17 +1,17 @@
// RUN: %clang_cc1 -triple i686-windows -fdeclspec -fsyntax-only -verify %s
__declspec(dllimport) typedef int typedef1;
-// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, classes, and Objective-C interfaces}}
typedef __declspec(dllimport) int typedef2;
-// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
typedef int __declspec(dllimport) typedef3;
-// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
typedef __declspec(dllimport) void (*FunTy)();
-// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
enum __declspec(dllimport) E { Val };
-// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
struct __declspec(dllimport) Record {};
-// expected-warning@-1{{'dllimport' attribute only applies to functions, variables, and Objective-C interfaces}}
+// expected-warning@-1{{'dllimport' attribute only applies to}}
__declspec(dllimport)
__attribute__((__objc_root_class__))
diff --git a/clang/test/SemaObjC/format-arg-attribute.m b/clang/test/SemaObjC/format-arg-attribute.m
index 8ad34e38738..67c9c2e3d4c 100644
--- a/clang/test/SemaObjC/format-arg-attribute.m
+++ b/clang/test/SemaObjC/format-arg-attribute.m
@@ -9,9 +9,9 @@ extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-err
extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{'format_arg' attribute takes one argument}}
extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{'format_arg' attribute takes one argument}}
-struct s1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to non-K&R-style functions}}
-union u1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to non-K&R-style functions}}
-enum e1 { E1V0 } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to non-K&R-style functions}}
+struct s1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to Objective-C methods and non-K&R-style functions}}
+union u1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to}}
+enum e1 { E1V0 } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to}}
extern NSString *ff3 (const NSString *) __attribute__((format_arg(3-2)));
extern NSString *ff4 (const NSString *) __attribute__((format_arg(foo))); // expected-error {{use of undeclared identifier 'foo'}}
diff --git a/clang/test/SemaObjC/objc-asm-attribute-neg-test.m b/clang/test/SemaObjC/objc-asm-attribute-neg-test.m
index 2fb6643adde..98f39fb9001 100644
--- a/clang/test/SemaObjC/objc-asm-attribute-neg-test.m
+++ b/clang/test/SemaObjC/objc-asm-attribute-neg-test.m
@@ -15,15 +15,15 @@ __attribute__((objc_runtime_name("MySecretNamespace.Protocol")))
__attribute__((objc_runtime_name("MySecretNamespace.Message")))
@interface Message <Protocol> {
-__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
+__attribute__((objc_runtime_name("MySecretNamespace.Message"))) // expected-error {{'objc_runtime_name' attribute only applies to Objective-C interfaces and Objective-C protocols}}
id MyIVAR;
}
__attribute__((objc_runtime_name("MySecretNamespace.Message")))
@property int MyProperty; // expected-error {{prefix attribute must be followed by an interface or protocol}}}}
-- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
+- (int) getMyProperty __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
-- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to interface or protocol declarations}}
+- (void) setMyProperty : (int) arg __attribute__((objc_runtime_name("MySecretNamespace.Message"))); // expected-error {{'objc_runtime_name' attribute only applies to}}
@end
diff --git a/clang/test/SemaObjC/objcbridge-attribute-arc.m b/clang/test/SemaObjC/objcbridge-attribute-arc.m
index 3bcfdf48e79..f7473cc0f32 100644
--- a/clang/test/SemaObjC/objcbridge-attribute-arc.m
+++ b/clang/test/SemaObjC/objcbridge-attribute-arc.m
@@ -32,7 +32,7 @@ typedef XXX *CFUColor2Ref;
@interface I
{
- __attribute__((objc_bridge(NSError))) void * color; // expected-error {{'objc_bridge' attribute only applies to structs, unions, and typedefs}};
+ __attribute__((objc_bridge(NSError))) void * color; // expected-error {{'objc_bridge' attribute only applies to structs, unions, classes, and typedefs}};
}
@end
diff --git a/clang/test/SemaObjC/objcbridge-attribute.m b/clang/test/SemaObjC/objcbridge-attribute.m
index 9cab64ec6b2..c93543caa67 100644
--- a/clang/test/SemaObjC/objcbridge-attribute.m
+++ b/clang/test/SemaObjC/objcbridge-attribute.m
@@ -38,7 +38,7 @@ typedef struct Opaque *OpaqueRef __attribute__((objc_bridge(id))); // expected-e
@interface I
{
- __attribute__((objc_bridge(NSError))) void * color; // expected-error {{'objc_bridge' attribute only applies to structs, unions, and typedefs}};
+ __attribute__((objc_bridge(NSError))) void * color; // expected-error {{'objc_bridge' attribute only applies to structs, unions, classes, and typedefs}};
}
@end
OpenPOWER on IntegriCloud