Commit 5ae3fdc
committed
[clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access
We were missing a call to DiagnoseUseOfDecl when performing typename access.
This refactors the code so that TypeDecl lookups funnel through a helper which performs all the necessary checks, removing some related duplication on the way.
When diagnosing availability uses through typedefs, this changes the implementation so it won't dig through
subst nodes, as those uses should be diagnosed through the template specialization it was accessed from.
This takes care of the regression reported here: #129681 (comment)
Fixes #58547
Differential Revision: https://reviews.llvm.org/D1365331 parent 754eeea commit 5ae3fdc
File tree
7 files changed
+92
-36
lines changed- clang
- docs
- include/clang/Sema
- lib/Sema
- test
- CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated
- Sema
7 files changed
+92
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
38 | 41 | | |
39 | 42 | | |
40 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3168 | 3168 | | |
3169 | 3169 | | |
3170 | 3170 | | |
| 3171 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
3171 | 3178 | | |
3172 | 3179 | | |
3173 | 3180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
103 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
104 | 106 | | |
105 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
106 | 118 | | |
107 | 119 | | |
| 120 | + | |
| 121 | + | |
108 | 122 | | |
109 | | - | |
110 | 123 | | |
111 | | - | |
| 124 | + | |
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
142 | 162 | | |
143 | 163 | | |
144 | 164 | | |
| |||
295 | 315 | | |
296 | 316 | | |
297 | 317 | | |
| 318 | + | |
298 | 319 | | |
299 | 320 | | |
300 | | - | |
301 | | - | |
| 321 | + | |
| 322 | + | |
302 | 323 | | |
303 | 324 | | |
304 | 325 | | |
| |||
322 | 343 | | |
323 | 344 | | |
324 | 345 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | 346 | | |
| 347 | + | |
| 348 | + | |
330 | 349 | | |
331 | 350 | | |
332 | 351 | | |
| |||
515 | 534 | | |
516 | 535 | | |
517 | 536 | | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
530 | 541 | | |
531 | 542 | | |
532 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10930 | 10930 | | |
10931 | 10931 | | |
10932 | 10932 | | |
10933 | | - | |
10934 | | - | |
10935 | | - | |
10936 | | - | |
10937 | | - | |
10938 | | - | |
10939 | | - | |
10940 | | - | |
| 10933 | + | |
| 10934 | + | |
| 10935 | + | |
| 10936 | + | |
| 10937 | + | |
10941 | 10938 | | |
10942 | 10939 | | |
10943 | | - | |
10944 | | - | |
10945 | | - | |
10946 | | - | |
| 10940 | + | |
| 10941 | + | |
10947 | 10942 | | |
10948 | 10943 | | |
10949 | 10944 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments