[PATCH] D26459: Fix mismatched enum value name and diagnostic text.

2016-11-11 Thread Douglas Katzman via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL286599: Fix mismatched enum value name and diagnostic text. 
(authored by dougk).

Changed prior to commit:
  https://reviews.llvm.org/D26459?vs=77367=77624#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26459

Files:
  cfe/trunk/include/clang/Basic/Attr.td
  cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
  cfe/trunk/include/clang/Sema/AttributeList.h
  cfe/trunk/test/Sema/attr-section.c


Index: cfe/trunk/test/Sema/attr-section.c
===
--- cfe/trunk/test/Sema/attr-section.c
+++ cfe/trunk/test/Sema/attr-section.c
@@ -10,12 +10,12 @@
 
 // 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.
 }
 
 // pr9356
 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}}
Index: cfe/trunk/include/clang/Sema/AttributeList.h
===
--- cfe/trunk/include/clang/Sema/AttributeList.h
+++ cfe/trunk/include/clang/Sema/AttributeList.h
@@ -885,6 +885,7 @@
   ExpectedFunction,
   ExpectedUnion,
   ExpectedVariableOrFunction,
+  ExpectedFunctionOrGlobalVar,
   ExpectedFunctionVariableOrObjCInterface,
   ExpectedFunctionOrMethod,
   ExpectedParameter,
Index: cfe/trunk/include/clang/Basic/Attr.td
===
--- cfe/trunk/include/clang/Basic/Attr.td
+++ cfe/trunk/include/clang/Basic/Attr.td
@@ -382,7 +382,7 @@
   let Spellings = [GCC<"alias">];
   let Args = [StringArgument<"Aliasee">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
- "ExpectedFunctionGlobalVarMethodOrProperty">;
+ "ExpectedFunctionOrGlobalVar">;
   let Documentation = [Undocumented];
 }
 
@@ -1746,7 +1746,7 @@
GCC<"no_sanitize_thread">,
GNU<"no_sanitize_memory">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
-"ExpectedFunctionGlobalVarMethodOrProperty">;
+"ExpectedFunctionOrGlobalVar">;
   let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs,
NoSanitizeMemoryDocs];
   let ASTNode = 0;
Index: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
===
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
@@ -2599,6 +2599,7 @@
   "functions"
   "|unions"
   "|variables and functions"
+  "|functions and global variables"
   "|functions, variables, and Objective-C interfaces"
   "|functions and methods"
   "|parameters"
@@ -2629,7 +2630,7 @@
   "|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"


Index: cfe/trunk/test/Sema/attr-section.c
===
--- cfe/trunk/test/Sema/attr-section.c
+++ cfe/trunk/test/Sema/attr-section.c
@@ -10,12 +10,12 @@
 
 // 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.
 }
 
 // pr9356
 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 

[PATCH] D26459: Fix mismatched enum value name and diagnostic text.

2016-11-09 Thread Douglas Katzman via cfe-commits
dougk updated this revision to Diff 77367.
dougk added a comment.

inadvertent omission of attr-section.c test


https://reviews.llvm.org/D26459

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/AttributeList.h
  test/Sema/attr-section.c


Index: test/Sema/attr-section.c
===
--- test/Sema/attr-section.c
+++ test/Sema/attr-section.c
@@ -10,7 +10,7 @@
 
 // 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 __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}}
Index: include/clang/Sema/AttributeList.h
===
--- include/clang/Sema/AttributeList.h
+++ include/clang/Sema/AttributeList.h
@@ -885,6 +885,7 @@
   ExpectedFunction,
   ExpectedUnion,
   ExpectedVariableOrFunction,
+  ExpectedFunctionOrGlobalVar,
   ExpectedFunctionVariableOrObjCInterface,
   ExpectedFunctionOrMethod,
   ExpectedParameter,
Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2597,6 +2597,7 @@
   "functions"
   "|unions"
   "|variables and functions"
+  "|functions and global variables"
   "|functions, variables, and Objective-C interfaces"
   "|functions and methods"
   "|parameters"
@@ -2627,7 +2628,7 @@
   "|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"
Index: include/clang/Basic/Attr.td
===
--- include/clang/Basic/Attr.td
+++ include/clang/Basic/Attr.td
@@ -382,7 +382,7 @@
   let Spellings = [GCC<"alias">];
   let Args = [StringArgument<"Aliasee">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
- "ExpectedFunctionGlobalVarMethodOrProperty">;
+ "ExpectedFunctionOrGlobalVar">;
   let Documentation = [Undocumented];
 }
 
@@ -1746,7 +1746,7 @@
GCC<"no_sanitize_thread">,
GNU<"no_sanitize_memory">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
-"ExpectedFunctionGlobalVarMethodOrProperty">;
+"ExpectedFunctionOrGlobalVar">;
   let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs,
NoSanitizeMemoryDocs];
   let ASTNode = 0;


Index: test/Sema/attr-section.c
===
--- test/Sema/attr-section.c
+++ test/Sema/attr-section.c
@@ -10,7 +10,7 @@
 
 // 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 __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}}
Index: include/clang/Sema/AttributeList.h
===
--- include/clang/Sema/AttributeList.h
+++ include/clang/Sema/AttributeList.h
@@ -885,6 +885,7 @@
   ExpectedFunction,
   ExpectedUnion,
   ExpectedVariableOrFunction,
+  ExpectedFunctionOrGlobalVar,
   

[PATCH] D26459: Fix mismatched enum value name and diagnostic text.

2016-11-09 Thread Douglas Katzman via cfe-commits
dougk created this revision.
dougk added a reviewer: aaron.ballman.
dougk added a subscriber: cfe-commits.
Herald added a subscriber: aemerson.

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"


https://reviews.llvm.org/D26459

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/AttributeList.h


Index: include/clang/Sema/AttributeList.h
===
--- include/clang/Sema/AttributeList.h
+++ include/clang/Sema/AttributeList.h
@@ -885,6 +885,7 @@
   ExpectedFunction,
   ExpectedUnion,
   ExpectedVariableOrFunction,
+  ExpectedFunctionOrGlobalVar,
   ExpectedFunctionVariableOrObjCInterface,
   ExpectedFunctionOrMethod,
   ExpectedParameter,
Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2597,6 +2597,7 @@
   "functions"
   "|unions"
   "|variables and functions"
+  "|functions and global variables"
   "|functions, variables, and Objective-C interfaces"
   "|functions and methods"
   "|parameters"
@@ -2627,7 +2628,7 @@
   "|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"
Index: include/clang/Basic/Attr.td
===
--- include/clang/Basic/Attr.td
+++ include/clang/Basic/Attr.td
@@ -382,7 +382,7 @@
   let Spellings = [GCC<"alias">];
   let Args = [StringArgument<"Aliasee">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
- "ExpectedFunctionGlobalVarMethodOrProperty">;
+ "ExpectedFunctionOrGlobalVar">;
   let Documentation = [Undocumented];
 }
 
@@ -1746,7 +1746,7 @@
GCC<"no_sanitize_thread">,
GNU<"no_sanitize_memory">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
-"ExpectedFunctionGlobalVarMethodOrProperty">;
+"ExpectedFunctionOrGlobalVar">;
   let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs,
NoSanitizeMemoryDocs];
   let ASTNode = 0;


Index: include/clang/Sema/AttributeList.h
===
--- include/clang/Sema/AttributeList.h
+++ include/clang/Sema/AttributeList.h
@@ -885,6 +885,7 @@
   ExpectedFunction,
   ExpectedUnion,
   ExpectedVariableOrFunction,
+  ExpectedFunctionOrGlobalVar,
   ExpectedFunctionVariableOrObjCInterface,
   ExpectedFunctionOrMethod,
   ExpectedParameter,
Index: include/clang/Basic/DiagnosticSemaKinds.td
===
--- include/clang/Basic/DiagnosticSemaKinds.td
+++ include/clang/Basic/DiagnosticSemaKinds.td
@@ -2597,6 +2597,7 @@
   "functions"
   "|unions"
   "|variables and functions"
+  "|functions and global variables"
   "|functions, variables, and Objective-C interfaces"
   "|functions and methods"
   "|parameters"
@@ -2627,7 +2628,7 @@
   "|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"
Index: include/clang/Basic/Attr.td
===
--- include/clang/Basic/Attr.td
+++ include/clang/Basic/Attr.td
@@ -382,7 +382,7 @@
   let Spellings = [GCC<"alias">];
   let Args = [StringArgument<"Aliasee">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
- "ExpectedFunctionGlobalVarMethodOrProperty">;
+ "ExpectedFunctionOrGlobalVar">;
   let Documentation = [Undocumented];
 }
 
@@ -1746,7 +1746,7 @@
GCC<"no_sanitize_thread">,
GNU<"no_sanitize_memory">];
   let Subjects = SubjectList<[Function, GlobalVar], ErrorDiag,
-"ExpectedFunctionGlobalVarMethodOrProperty">;
+"ExpectedFunctionOrGlobalVar">;
   let Documentation = [NoSanitizeAddressDocs, NoSanitizeThreadDocs,
NoSanitizeMemoryDocs];
   let ASTNode = 0;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits