This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-19


2578. Undefined behavior when creating an invalid string literal via stringizing

Section: 15.6.3  [cpp.stringize]     Status: open     Submitter: US     Date: 2019-10-23     Liaison: SG12

(From National Body comment US 142 on the C++20 DIS.)

Subclause 15.6.3 [cpp.stringize] paragraph 2 specifies:

If the replacement that results is not a valid character string literal, the behavior is undefined.

Undefined behavior during lexing is not acceptable. This ought to be ill-formed.

Additional notes (January, 2023):

Forwarded to SG12 with paper issue 1409, by decision of the CWG and SG12 chairs.