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

Created on 2024-09-27.00:00:00 last changed 4 days ago

Messages

Date: 2024-11-09.00:21:39

Proposed resolution (approved by CWG 2024-11-08):

  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.10 [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-11-15.00:00:00

[Accepted as a DR at the November, 2024 meeting.]

(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-12-17 09:54:02adminsetstatus: ready -> dr
2024-12-06 09:40:31adminsetstatus: tentatively ready -> ready
2024-11-09 00:21:39adminsetstatus: open -> tentatively ready
2024-10-02 22:05:32adminsetmessages: + msg7832
2024-09-27 00:00:00admincreate