-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[Sema] Keep attribute lists in the order the attributes were parsed #162714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
dfb1520
8c99cbb
9b08278
9d171f9
cc15fc4
63703ab
ecf29ba
285412a
4e2a069
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ struct __attribute__((internal_linkage)) S { // expected-warning{{'internal_link | |
__attribute__((internal_linkage("foo"))) int g(void) {} // expected-error{{'internal_linkage' attribute takes no arguments}} | ||
|
||
int var6 [[clang::internal_linkage]]; | ||
int var7 [[clang::internal_linkage]] __attribute__((common)); // expected-error{{'clang::internal_linkage' and 'common' attributes are not compatible}} \ | ||
int var7 [[clang::internal_linkage]] __attribute__((common)); // expected-error{{'common' and 'clang::internal_linkage' attributes are not compatible}} \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that the original order was better. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For context this is what the diagnostic looks like in the terminal:
I think it makes sense to emit the error on the last occurring attribute, and I also think it makes sense to mention the erroring attribute first in the diagnostics message. This is also what this diagnostic almost always did already. Would you prefer that the diagnostic was rephrased? Maybe something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I think that the rephrasing of the warning would absolutely help! |
||
// expected-note{{conflicting attribute is here}} | ||
__attribute__((common)) int var8 [[clang::internal_linkage]]; // expected-error{{'clang::internal_linkage' and 'common' attributes are not compatible}} \ | ||
// expected-note{{conflicting attribute is here}} |
Uh oh!
There was an error while loading. Please reload this page.