This is a proposed C++ paper (P2290R1) that has not been accepted yet
\x{XXXX} \u{XXXX} and \o{OOOO} are accepted in all languages mode
in characters and string literals.
Differential D105737
Implement delimited escape sequences. cor3ntin on Jul 9 2021, 2:09 PM. Authored by
Details
This is a proposed C++ paper (P2290R1) that has not been accepted yet \x{XXXX} \u{XXXX} and \o{OOOO} are accepted in all languages mode
Diff Detail
Event TimelineComment Actions Because this proposal hasn't been accepted by WG21 or WG14, but the syntax is not defined by either standard, I think it's reasonable to support this but with appropriate warnings about it being a Clang extension. Can you add those diagnostics? Also, this is lacking test coverage for C.
Comment Actions
between 2 concatenated strings, and sequences containing digit
Comment Actions When preprocessing, treat incomplete or empty Overflow is still treated as an error. Comment Actions Mostly some small nits.
Comment Actions Address most of the comments I left warn_delimited_ucn and err_ucn_escape_incomplete Comment Actions This proposal has now been seen by both WG14 and WG21 and has sentiment for support in both committees. I think the extension diagnostic is still reasonable (we'll want to support this syntax in older language modes when both committees adopt it for a newer language mode). LGTM, I'm down to only some minor nits with the patch. @rsmith, do you have any concerns you'd like to see addressed before landing this?
Comment Actions Just to clarify, I don't think this should be allowed in C++20 or C17. Do you agree? Comment Actions I could agree, but I'm wondering why you don't want to allow in older language modes? Clang typically allows conforming extensions in older language modes (with appropriate diagnostics), and this would qualify. e.g., https://godbolt.org/z/x5Ws6YdGc Comment Actions Thank you for the new feature! I've landed on your behalf in 274adcb866343cb505408d8f401840ea814522c8. |
We usually capitalize Clang for this kind of diagnostic.