Title
A module import needs a header-name as a token
Status
tentatively ready
Section
5.10 [lex.token]
Submitter
Hubert Tong

Created on 2025-11-18.00:00:00 last changed 1 week ago

Messages

Date: 2025-12-05.21:43:30

Proposed resolution (approved by CWG 2025-12-05):

  1. Change in 5.5 [lex.pptoken] paragraph 2 as follows:

    Each preprocessing token that is converted to a token (5.10 [lex.token]) shall have the lexical form of a keyword, an identifier, a literal, a header name, or an operator or punctuator.
  2. Change in 5.10 [lex.token] as follows:

      token:
         identifier
         keyword
         literal
         header-name
         operator-or-punctuator
    
    There are five six kinds of tokens: identifiers, keywords, literals [ Footnote: ... ], header names, operators, and other separators. ...
Date: 2025-11-18.00:00:00

(From submission #812.)

Consider:

  import "myheader.h";

The (phase 7) grammar module-import-declaration (10.3 [module.import]) expects a header-name, but that is not a valid token per 5.10 [lex.token].

History
Date User Action Args
2025-12-05 21:43:30adminsetstatus: open -> tentatively ready
2025-11-18 22:12:05adminsetmessages: + msg8396
2025-11-18 00:00:00admincreate