Commit 51b0532
committed
Suppress __COUNTER__ warning from newest Clang versions
Ideally we could suppress the warning locally in the `UNIQUE_NAME` macro,
but that runs into at least 2 issues:
1) Clang actually does not consider the warning as coming from inside the
`UNIQUE_NAME` macro, even though it correctly points to its expansion
as the problem. This means that adding `_Pragma`s inside the macro
around the __COUNTER__ usage does not actually silence the warning.
2) Adding the local suppressions anyway breaks the expansion of
`MAKE_NAMESPACE` macro inside the templated test case macros. This can
be fixed for the newest clang version by removing its use and using
the uniqued `TestName` for the namespace name directly, but this breaks
compilation on GCC, and older Clang versions.
Because of these issues, we introduce global warning suppression for
`-Wc2y-extensions` to be done with it. We should revisit this if Clang 23
fixes the local pragma based suppression, when it might be worth the effort
to rework the templated test case macros to support it.
Closes #30761 parent 2ec64d1 commit 51b0532
2 files changed
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| |||
429 | 434 | | |
430 | 435 | | |
431 | 436 | | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
432 | 440 | | |
433 | 441 | | |
434 | 442 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
12 | 24 | | |
13 | 25 | | |
| 26 | + | |
14 | 27 | | |
15 | 28 | | |
16 | 29 | | |
| |||
0 commit comments