Files
2025-10-25 03:02:53 +03:00

1.3 KiB

[diff.cpp11.lex]

Annex C (informative) Compatibility [diff]

C.5 C++ and ISO C++ 2011 [diff.cpp11]

C.5.2 [lex]: lexical conventions [diff.cpp11.lex]

1

#

Affected subclause: [lex.ppnumber]

Change: pp-number can contain one or more single quotes.

Rationale: Necessary to enable single quotes as digit separators.

Effect on original feature: Valid C++ 2011 code may fail to compile or may change meaning in this revision of C++.

For example, the following code is valid both in C++ 2011 and in this revision of C++, but the macro invocation produces different outcomes because the single quotes delimit a character-literal in C++ 2011, whereas they are digit separators in this revision of C++.

[Example 1: #define M(x, ...) __VA_ARGS__int x[2] = { M(1'2,3'4, 5) };// int x[2] = { 5 }; --- C++ 2011// int x[2] = { 3'4, 5 }; --- this revision of C++ — end example]