Skip to content

CWG3016 [cpp.cond] __has_include diagnosable rule re: syntax that is impossible to violate #691

Description

@hubert-reinterpretcast

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

Reference (section label): cpp.cond

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

Issue description:
https://wg21.link/cpp.cond#4 says:

The header or source file identified by the parenthesized preprocessing token sequence in each contained has-include-expression is searched for as if that preprocessing token sequence were the pp-tokens in a #include directive, except that no further macro expansion is performed. If such a directive would not satisfy the syntactic requirements of a #include directive, the program is ill-formed.

Such a directive would always satisfy the syntactic requirements of a #include directive, because #include syntactically accepts pp-tokens (https://wg21.link/cpp.include#4).

Suggested resolution:

If the preprocessing token sequence does not consist solely of a header-name or cannot be combined ([cpp.include]) into a single header-name preprocessing token, the program is ill-formed.

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