summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Katzman <dougk@google.com>2016-11-11 16:51:40 +0000
committerDouglas Katzman <dougk@google.com>2016-11-11 16:51:40 +0000
commit180529892dc4e867d96cd470b09e58073b0c70b3 (patch)
tree9c1d18c25b6d2367ed6a736763c9d4b2e704bd5f
parenta6ccd1903517b9e1ce1709c144f6a758c325c5d9 (diff)
downloadbcm5719-llvm-180529892dc4e867d96cd470b09e58073b0c70b3.tar.gz
bcm5719-llvm-180529892dc4e867d96cd470b09e58073b0c70b3.zip
Fix mismatched enum value name and diagnostic text.
ExpectedFunctionGlobalVarMethodOrProperty would previously say "functions and global variables" instead of "functions, methods, properties, and global variables" The newly added ExpectedFunctionOrGlobalVariable says "functions and global variables" Differential Revision: https://reviews.llvm.org/D26459 llvm-svn: 286599
-rw-r--r--clang/include/clang/Basic/Attr.td4
-rw-r--r--clang/include/clang/Basic/DiagnosticSemaKinds.td3
-rw-r--r--clang/include/clang/Sema/AttributeList.h1
-rw-r--r--clang/test/Sema/attr-section.c4
4 files changed, 7 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 173c1749a4d..46924959c2d 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -382,7 +382,7 @@ def Alias : Attr {
let Spellings = [GCC<"alias">];
let Args = [StringArgument<"Aliasee">];
let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
- "ExpectedFunctionGlobalVarMethodOrProperty">;
+ "ExpectedFunctionOrGlobalVar">;
let Documentation = [Undocumented];
}
@@ -1746,7 +1746,7 @@ def NoSanitizeSpecific : InheritableAttr {
GCC<"no_sanitize_thread">,
GNU<"no_sanitize_memory">];
let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
- "ExpectedFunctionGlobalVarMethodOrProperty">;
+ "ExpectedFunctionOrGlobalVar">;
let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs,
NoSanitizeMemoryDocs];
let ASTNode = 0;
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 4e7b6649955..cc08434f5d3 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2599,6 +2599,7 @@ def warn_attribute_wrong_decl_type : Warning<
"functions"
"|unions"
"|variables and functions"
+ "|functions and global variables"
"|functions, variables, and Objective-C interfaces"
"|functions and methods"
"|parameters"
@@ -2629,7 +2630,7 @@ def warn_attribute_wrong_decl_type : Warning<
"|functions, variables, classes, and Objective-C interfaces"
"|Objective-C protocols"
"|variables with static or thread storage duration"
- "|functions and global variables"
+ "|functions, methods, properties, and global variables"
"|structs, unions, and typedefs"
"|structs and typedefs"
"|interface or protocol declarations"
diff --git a/clang/include/clang/Sema/AttributeList.h b/clang/include/clang/Sema/AttributeList.h
index 96653ef8ea4..0c56b3fa346 100644
--- a/clang/include/clang/Sema/AttributeList.h
+++ b/clang/include/clang/Sema/AttributeList.h
@@ -885,6 +885,7 @@ enum AttributeDeclKind {
ExpectedFunction,
ExpectedUnion,
ExpectedVariableOrFunction,
+ ExpectedFunctionOrGlobalVar,
ExpectedFunctionVariableOrObjCInterface,
ExpectedFunctionOrMethod,
ExpectedParameter,
diff --git a/clang/test/Sema/attr-section.c b/clang/test/Sema/attr-section.c
index 812de067180..c64b10d80ff 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 and global variables}}
+ __attribute__((section("NEAR,x"))) int n1; // expected-error {{'section' attribute only applies to functions, methods, properties, and global variables}}
__attribute__((section("NEAR,x"))) static int n2; // ok.
}
@@ -18,4 +18,4 @@ 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 and global variables}}
+enum __attribute__((section("NEAR,x"))) e { one }; // expected-error {{'section' attribute only applies to functions, methods, properties, and global variables}}
OpenPOWER on IntegriCloud