Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please add more details to the patch summary explaining why you're making these changes. Also, I assume this is to be backported to Clang 17? If so, I'd like @hubert.reinterpretcast to mention if this works for his needs.
I kind of figured. :-) But we want the context in the patch summary since that's what typically makes it to the commit message, and we don't want folks doing code archeology to have to click through to figure that context out.
clang/test/SemaCXX/static-assert.cpp | ||
---|---|---|
44–45 | I doubt that it is a problem, but Clang 16 accepted such hex escapes. |
clang/test/CXX/dcl.dcl/dcl.link/p2.cpp | ||
---|---|---|
11–14 | Note that was ill-formed in clang 16, despite being well-formed in the standard. | |
clang/test/SemaCXX/static-assert.cpp | ||
44–45 | Yes, I only downgraded to a warning what you had reports about. |
We are putting together a build for the (known) affected groups. I will report back when we have results.
clang/include/clang/Basic/DiagnosticLexKinds.td | ||
---|---|---|
290 | I am not seeing any tests covering C mode. @aaron.ballman, can you confirm that you are okay with the warning when processing C code (and, moreover, the newly-added errors for numeric escape sequences)? |
clang/include/clang/Basic/DiagnosticLexKinds.td | ||
---|---|---|
290 | Good call on C test coverage, thank you for bringing that up! I think the behavior in C is reasonable, even if it's not mandated by the standard. We're going from issuing an error in C to issuing a warning and the warning text helpfully omits the C++2c part of the diagnostic, so it seems like we're more relaxed in C than we previously were. Do you have concerns about the behavior in C? (Or are you saying you'd prefer this to be an error in C as it was before?) |
clang/include/clang/Basic/DiagnosticLexKinds.td | ||
---|---|---|
290 | My question was with respect to the change from the Clang 16 status quo for numeric escapes introduced by the prior change and carried forward with this one: https://godbolt.org/z/aneGr1Yfb _Static_assert(1, "\x30"); // error in Clang 17 |
clang/include/clang/Basic/DiagnosticLexKinds.td | ||
---|---|---|
290 | Yes, this is intended, numeric escape sequences in unevaluated string literals are not allowed in any language modes - the motivation for C is the same as C++. |
clang/include/clang/Basic/DiagnosticLexKinds.td | ||
---|---|---|
290 | Barring evidence that we're breaking working code without workarounds, I'm happy with the behavior in C. I don't think numeric escape sequences make a lot of sense in the contexts where these strings appear in C, same as for C++. However, if we had evidence that this breaks working code in problematic ways, we could consider changing it to warning-defaults-to-error. |
Note: we are waiting for feedback from @hubert.reinterpretcast's people before progressing this.
The "full" build hit some (unrelated) snags, but the initial results look good. The patch is awaiting C test cases.
LGTM but please wait for @hubert.reinterpretcast to confirm the new tests cover what he was looking for.
I am not seeing any tests covering C mode.
@aaron.ballman, can you confirm that you are okay with the warning when processing C code (and, moreover, the newly-added errors for numeric escape sequences)?