Skip to content

[lex.name] prohibits uses of predefined macro names and feature-test macros CWG 2818 #5296

Closed
@JohelEGP

Description

@JohelEGP

This seems to prohibit uses of predefined macro names and library feature-test macros.

3# In addition, some identifiers are reserved for use by C++ implementations and shall not be used otherwise; no diagnostic is required.
(3.1) Each identifier that contains a double underscore __ or begins with an underscore followed by an uppercase letter is reserved to the implementation for any use.
(3.2) Each identifier that begins with an underscore is reserved to the implementation for use as a name in the global namespace.

More formally, according to [intro.compliance.general],

(2.3)
If a program contains a violation of a rule for which no diagnostic is required, this document places no requirement on implementations with respect to that program.

Permission to use predefined macro names and library feature-test macros needs to be added to [cpp.predefined] and [version.syn], respectively. For full effect, amend [lex.name]p3's "otherwise" to "unless otherwise specified".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions