Commit 56a3f3c
committed
[C] Diagnose use of C++ keywords in C
This adds a new diagnostic group, -Widentifier-is-c++-keyword, which is
off by default and grouped under -Wc++-compat. The diagnostic catches
use of C++ keywords in C code.
This change additionally fixes an issue with -Wreserved-identifier not
diagnosing use of reserved identifiers in function parameter lists.
Partially fixes #218981 parent ecdd3fd commit 56a3f3c
File tree
7 files changed
+279
-4
lines changed- clang
- docs
- include/clang/Basic
- lib
- Basic
- Sema
- test/Sema
7 files changed
+279
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
146 | 149 | | |
147 | 150 | | |
148 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
158 | 159 | | |
159 | | - | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
499 | 502 | | |
500 | 503 | | |
501 | 504 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
| 448 | + | |
448 | 449 | | |
449 | 450 | | |
450 | | - | |
451 | | - | |
| 451 | + | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
454 | 459 | | |
455 | 460 | | |
456 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
346 | 354 | | |
347 | 355 | | |
348 | 356 | | |
| |||
355 | 363 | | |
356 | 364 | | |
357 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
358 | 385 | | |
359 | 386 | | |
360 | 387 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
6107 | 6108 | | |
6108 | 6109 | | |
6109 | 6110 | | |
| 6111 | + | |
| 6112 | + | |
| 6113 | + | |
| 6114 | + | |
| 6115 | + | |
| 6116 | + | |
| 6117 | + | |
| 6118 | + | |
| 6119 | + | |
| 6120 | + | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
| 6124 | + | |
| 6125 | + | |
| 6126 | + | |
| 6127 | + | |
6110 | 6128 | | |
6111 | 6129 | | |
6112 | 6130 | | |
| |||
6118 | 6136 | | |
6119 | 6137 | | |
6120 | 6138 | | |
| 6139 | + | |
| 6140 | + | |
| 6141 | + | |
| 6142 | + | |
6121 | 6143 | | |
6122 | 6144 | | |
6123 | 6145 | | |
| |||
15311 | 15333 | | |
15312 | 15334 | | |
15313 | 15335 | | |
| 15336 | + | |
15314 | 15337 | | |
15315 | 15338 | | |
15316 | 15339 | | |
| |||
0 commit comments