Skip to content

CWG3012 [dcl.constexpr] Redeclaration without constexpr in another TU should not require diagnostic. #683

@keinflue

Description

@keinflue

Full name of submitter (unless configured in github; will be published with the issue): Benjamin Sch.

Reference (section label): [dcl.constexpr]

Link to reflector thread (if any):

Issue description:

[dcl.constexpr]/1 currently says:

If any declaration of a function or function template has a constexpr or consteval specifier, then all its declarations shall contain the same specifier.

This seems to imply that a mismatching constexpr on two declarations in different TU needs to be diagnosed.

Suggested resolution:

Insert after the quoted sentence:

No diagnostic is required if neither the declaration with the specifier nor the declaration without the specifier is reachable from the other.

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