Commit 5e28af0
authored
[C] Fix parsing of [[clang::assume]] (llvm#141747)
The assumption attribute is exposed with a Clang spelling, which means
we support __attribute__((assume)) as well as [[clang::assume]] as
spellings for the attribute.
In C++, the [[clang::assume]] spelling worked as expected. In C, that
spelling would emit an "unknown attribute ignored" diagnostic. This was
happening because we were failing to pass in the scope name and source
location when creating the attribute. In C++, this worked by chance
because [[assume]] is a known attribute in C++. But in C, where there is
thankfully no [[assume]] standard attribute, the lack of a scope meant
we would set the attribute kind to "unknown".1 parent 2b1ebef commit 5e28af0
File tree
5 files changed
+45
-15
lines changed- clang
- docs
- include/clang/Parse
- lib/Parse
- test/Sema
5 files changed
+45
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
229 | 232 | | |
230 | 233 | | |
231 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3037 | 3037 | | |
3038 | 3038 | | |
3039 | 3039 | | |
3040 | | - | |
3041 | | - | |
3042 | | - | |
3043 | | - | |
3044 | | - | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
3045 | 3045 | | |
3046 | 3046 | | |
3047 | 3047 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
676 | 676 | | |
677 | 677 | | |
678 | 678 | | |
679 | | - | |
| 679 | + | |
| 680 | + | |
680 | 681 | | |
681 | 682 | | |
682 | 683 | | |
| |||
734 | 735 | | |
735 | 736 | | |
736 | 737 | | |
737 | | - | |
| 738 | + | |
| 739 | + | |
738 | 740 | | |
739 | 741 | | |
740 | 742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4452 | 4452 | | |
4453 | 4453 | | |
4454 | 4454 | | |
4455 | | - | |
4456 | | - | |
4457 | | - | |
4458 | | - | |
4459 | | - | |
| 4455 | + | |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
4460 | 4459 | | |
4461 | 4460 | | |
4462 | 4461 | | |
| |||
4498 | 4497 | | |
4499 | 4498 | | |
4500 | 4499 | | |
4501 | | - | |
4502 | | - | |
| 4500 | + | |
| 4501 | + | |
4503 | 4502 | | |
4504 | 4503 | | |
4505 | 4504 | | |
| |||
4565 | 4564 | | |
4566 | 4565 | | |
4567 | 4566 | | |
4568 | | - | |
| 4567 | + | |
| 4568 | + | |
4569 | 4569 | | |
4570 | 4570 | | |
4571 | 4571 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments