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


2693. Escape sequences for the string-literal of #line

Section: 15.7  [cpp.line]     Status: open     Submitter: CWG     Date: 2023-02-07     Liaison: WG14

The grammar for #line is inconsistent between 15.7 [cpp.line] paragraph 4:

# line digit-sequence " s-char-sequenceopt " new-line

and 15.7 [cpp.line] paragraph 1:

The string-literal of a #line directive, if present, shall be a character string literal.

The characters comprising the string-literal are not necessarily interpreted for e.g. escape sequences or universal-character-names, so the use of string-literal here is questionable. This directive names a source file, thus it might be better to use header-name (5.6 [lex.header]) instead.