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

2.1 KiB
Raw Permalink Blame History

[diff.cpp14.lex]

Annex C (informative) Compatibility [diff]

C.4 C++ and ISO C++ 2014 [diff.cpp14]

C.4.2 [lex]: lexical conventions [diff.cpp14.lex]

1

#

Affected subclause: [lex.phases]

Change: Removal of trigraph support as a required feature.

Rationale: Prevents accidental uses of trigraphs in non-raw string literals and comments.

Effect on original feature: Valid C++ 2014 code that uses trigraphs may not be valid or may have different semantics in this revision of C++.

Implementations may choose to translate trigraphs as specified in C++ 2014 if they appear outside of a raw string literal, as part of theimplementation-defined mapping from input source file characters to the translation character set.

2

#

Affected subclause: [lex.ppnumber]

Change: pp-number can contain p sign andP sign.

Rationale: Necessary to enable hexadecimal-floating-point-literals.

Effect on original feature: Valid C++ 2014 code may fail to compile or produce different results in this revision of C++.

Specifically, character sequences like 0p+0 and 0e1_p+0 are three separate tokens each in C++ 2014, but one single token in this revision of C++.

[Example 1: #define F(a) b ## aint b0p = F(0p+0); // ill-formed; equivalent to “int b0p = b0p + 0;'' in C++ 2014 — end example]