-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[Clang] adjust caret placement for the suggested attribute location for enum class #168092
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
68dc4b9
[Clang] adjust caret placement for the suggested attribute location f…
a-tarasyuk 5152768
derive enum attribute locations from EnumDecl instead of Lexer
a-tarasyuk 9f93393
remove lambda
a-tarasyuk a495ee9
cleanup, add additional comment
a-tarasyuk 7bc4552
Merge branch 'main' into fix/163224
a-tarasyuk 303b91b
Merge branch 'main' into fix/163224
a-tarasyuk 782923b
use explicit type
a-tarasyuk 253af19
Merge branch 'fix/163224' of https://github.com/a-tarasyuk/llvm-proje…
a-tarasyuk f0f5dfd
Merge branch 'main' into fix/163224
a-tarasyuk 1f565db
Merge branch 'main' into fix/163224
a-tarasyuk a394503
Merge branch 'main' into fix/163224
a-tarasyuk 444bfc5
track enum key source range in EnumDecl
a-tarasyuk 55ab1a4
Merge branch 'main' of https://github.com/llvm/llvm-project into fix/…
a-tarasyuk 3b4f729
Merge branch 'fix/163224' of https://github.com/a-tarasyuk/llvm-proje…
a-tarasyuk adefaa1
Merge branch 'main' into fix/163224
a-tarasyuk 62c9940
Merge branch 'main' into fix/163224
a-tarasyuk a959e14
Merge branch 'main' into fix/163224
a-tarasyuk f96b7a4
Merge branch 'main' into fix/163224
a-tarasyuk 784bf25
Merge branch 'main' into fix/163224
a-tarasyuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // RUN: %clang_cc1 -fsyntax-only -verify %s | ||
| // RUN: not %clang_cc1 -fsyntax-only -fdiagnostics-parseable-fixits -fno-diagnostics-show-line-numbers %s 2>&1 | FileCheck %s -strict-whitespace | ||
|
|
||
| [[nodiscard]] enum class E1 { }; | ||
| // expected-error@-1 {{misplaced attributes; expected attributes here}} | ||
| // CHECK: {{^}}{{\[\[}}nodiscard]] enum class E1 { }; | ||
| // CHECK: {{^}}~~~~~~~~~~~~~ ^ | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:1-[[@LINE-4]]:15}:"" | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:25-[[@LINE-5]]:25}:"{{\[\[}}nodiscard]]" | ||
|
|
||
| [[nodiscard]] enum struct E2 { }; | ||
| // expected-error@-1 {{misplaced attributes; expected attributes here}} | ||
| // CHECK: {{^}}{{\[\[}}nodiscard]] enum struct E2 { }; | ||
| // CHECK: {{^}}~~~~~~~~~~~~~ ^ | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:1-[[@LINE-4]]:15}:"" | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:26-[[@LINE-5]]:26}:"{{\[\[}}nodiscard]]" | ||
|
|
||
| [[nodiscard]] enum class E3 { }; | ||
| // expected-error@-1 {{misplaced attributes; expected attributes here}} | ||
| // CHECK: {{^}}{{\[\[}}nodiscard]] enum class E3 { }; | ||
| // CHECK: {{^}}~~~~~~~~~~~~~ ^ | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:1-[[@LINE-4]]:15}:"" | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:34-[[@LINE-5]]:34}:"{{\[\[}}nodiscard]]" | ||
|
|
||
| [[nodiscard]] enum /*comment*/ class E4 { }; | ||
| // expected-error@-1 {{misplaced attributes; expected attributes here}} | ||
| // CHECK: {{^}}{{\[\[}}nodiscard]] enum /*comment*/ class E4 { }; | ||
| // CHECK: {{^}}~~~~~~~~~~~~~ ^ | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:1-[[@LINE-4]]:15}:"" | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:38-[[@LINE-5]]:38}:"{{\[\[}}nodiscard]]" | ||
|
|
||
| [[nodiscard]] enum { A = 0 }; | ||
a-tarasyuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // expected-error@-1 {{misplaced attributes; expected attributes here}} | ||
| // CHECK: {{^}}{{\[\[}}nodiscard]] enum { A = 0 }; | ||
| // CHECK: {{^}}~~~~~~~~~~~~~ ^ | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:1-[[@LINE-4]]:15}:"" | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:19-[[@LINE-5]]:19}:"{{\[\[}}nodiscard]]" | ||
|
|
||
| namespace NS { | ||
| enum class E5; | ||
| } | ||
|
|
||
| [[nodiscard]] enum class NS::E5 { }; | ||
| // expected-error@-1 {{misplaced attributes; expected attributes here}} | ||
| // CHECK: {{^}}{{\[\[}}nodiscard]] enum class NS::E5 { }; | ||
| // CHECK: {{^}}~~~~~~~~~~~~~ ^ | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:1-[[@LINE-4]]:15}:"" | ||
| // CHECK: fix-it:"{{.*}}":{[[@LINE-5]]:25-[[@LINE-5]]:25}:"{{\[\[}}nodiscard]]" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.