Title
Grammar for preprocessing-file has no normative effect
Status
open
Section
5.2 [lex.phases]
Submitter
Brian Bi

Created on 2024-09-27.00:00:00 last changed 2 weeks ago

Messages

Date: 2024-10-02.22:05:32

Suggested resolution:

  1. Change in 5.2 [lex.phases] bullet 1.4 as follows:

    • ...
    • The source file is analyzed as a preprocessing-file (15.1 [cpp.pre]). Preprocessing directives are executed, macro invocations are expanded, and _Pragma unary operator expressions are executed. A #include preprocessing directive causes the named header or source file to be processed from phase 1 through phase 4, recursively. All preprocessing directives are then deleted.
    • ...
  2. Change in 5.2 [lex.phases] bullet 1.7 as follows:

    Whitespace characters separating tokens are no longer significant. Each preprocessing token is converted into a token (5.6 [lex.token]). The resulting tokens constitute a translation unit and are syntactically and semantically analyzed as a translation-unit (6.6 [basic.link]) and translated.
Date: 2024-09-27.00:00:00

(From submission #615.)

Subclause 15.1 [cpp.pre] defines the grammar production preprocessing-file, but nothing in the standard specifies that a translation unit is ill-formed if it fails to match that grammar. Similarly, translation-unit has no effect.

History
Date User Action Args
2024-10-02 22:05:32adminsetmessages: + msg7832
2024-09-27 00:00:00admincreate