Skip to content

CWG3126 [lex.token] All header imports are ill-formed: _header-name_s are not tokens #812

Description

@hubert-reinterpretcast

Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong

Reference (section label): [lex.token], [lex.pptoken], [lex.phases], [cpp.import], [module.import]

Link to reflector thread (if any): N/A

Issue description:

Consider:

import "myheader.h";

https://wg21.link/module.import describes the phase 7 treatment following the transformation specified by https://wg21.link/cpp.import#4. The grammar for module-import-declaration contains a use of the header-name non-terminal, but header-name‌s are not token‌s (https://wg21.link/lex.token). This means that the conversion from a preprocessing token to a token (https://wg21.link/lex.phases) runs afoul of https://wg21.link/lex.pptoken#2.

Suggested resolution:

Add header-name as an alternative for the token non-terminal, and update [lex.pptoken] paragraph 2 to allow header names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions