summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2018-03-04 16:24:10 +0000
committerAaron Ballman <aaron@aaronballman.com>2018-03-04 16:24:10 +0000
commit5302604c328d299457150455b73a90d04604d1e5 (patch)
treea4a9927c7b5e1d7964d941c9dd3fdcf30937f6ea
parent3cfa9d1d617588bd0580ba6d62846ab9adfd5d7e (diff)
downloadbcm5719-llvm-5302604c328d299457150455b73a90d04604d1e5.tar.gz
bcm5719-llvm-5302604c328d299457150455b73a90d04604d1e5.zip
Amend r326665 to print out the `used` attribute subjects in a different order.
llvm-svn: 326676
-rw-r--r--clang/include/clang/Basic/Attr.td2
-rw-r--r--clang/test/Sema/attr-used.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 5969c161f78..92d1dd60151 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -2010,7 +2010,7 @@ def Unused : InheritableAttr {
def Used : InheritableAttr {
let Spellings = [GCC<"used">];
- let Subjects = SubjectList<[Function, ObjCMethod, NonLocalVar]>;
+ let Subjects = SubjectList<[NonLocalVar, Function, ObjCMethod]>;
let Documentation = [Undocumented];
}
diff --git a/clang/test/Sema/attr-used.c b/clang/test/Sema/attr-used.c
index 344c772301c..c13d57c95e6 100644
--- a/clang/test/Sema/attr-used.c
+++ b/clang/test/Sema/attr-used.c
@@ -3,7 +3,7 @@
extern int l0 __attribute__((used)); // expected-warning {{'used' attribute ignored}}
__private_extern__ int l1 __attribute__((used)); // expected-warning {{'used' attribute ignored}}
-struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to functions, Objective-C methods, and variables with non-local storage}}
+struct __attribute__((used)) s { // expected-warning {{'used' attribute only applies to variables with non-local storage, functions, and Objective-C methods}}
int x;
};
@@ -14,7 +14,7 @@ static void __attribute__((used)) f0(void) {
void f1() {
static int a __attribute__((used));
- int b __attribute__((used)); // expected-warning {{'used' attribute only applies to functions, Objective-C methods, and variables with non-local storage}}
+ int b __attribute__((used)); // expected-warning {{'used' attribute only applies to variables with non-local storage, functions, and Objective-C methods}}
}
static void __attribute__((used)) f0(void);
OpenPOWER on IntegriCloud