sg22-c-cpp-standard-compatibility / sg-compatibility

A joint Study Group between the C (WG14) and C++ (WG21) Committees to ensure the longterm synchronization and cooperation of the C and C++ programming languages where any mutual interests lie.
1 stars 0 forks source link

CWG #2693: Escape sequences for the string-literal of #line #28

Open NinaRanns opened 10 months ago

NinaRanns commented 10 months ago

Notify WG14 of CWG #2693 issue

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.8 [lex.header]) instead.