This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Adjust extension warnings for delimited sequences
ClosedPublic

Authored by cor3ntin on Jul 13 2022, 10:05 AM.

Details

Summary

WG21 approved delimited escape sequences and named escape
sequences.
Adjust the extension warnings accordingly, and update
the release notes.

Diff Detail

Event Timeline

cor3ntin created this revision.Jul 13 2022, 10:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 10:05 AM
cor3ntin requested review of this revision.Jul 13 2022, 10:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2022, 10:05 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
cor3ntin updated this revision to Diff 444322.Jul 13 2022, 10:06 AM

Forgot to format!

@aaron.ballman I think we might as well do that now, and revert if WG21 does some funny business in plenary. WDYT?

aaron.ballman accepted this revision.Jul 13 2022, 12:31 PM

LGTM! If for some very surprising reason either of these papers fail in plenary, we can easily revert this as necessary.

This revision is now accepted and ready to land.Jul 13 2022, 12:31 PM

While accepting all these inside of string and character literals in C and C++20 and older is fine, accepting them inside of identifiers can change meaning of valid programs.
https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600620.html
#define z(x) 0
#define a z(
int x = a\N{LATIN SMALL LETTER U WITH DIAERESIS});
int y = a\u{1234});
int z = a\U{12345678});

While accepting all these inside of string and character literals in C and C++20 and older is fine, accepting them inside of identifiers can change meaning of valid programs.

Thank you for reporting this impact, @jakubjelinek! I'll copy you on an email to WG21 that discussed the impact, specifically with regard to the glibc header for which Joseph reported failures.