Skip to content

[module.interface] Example does not seem to match normative wording CWG2491 #4540

@cpplearner

Description

@cpplearner

[module.interface]/6:

A redeclaration of an entity or typedef-name X is implicitly exported if X was introduced by an exported declaration; otherwise it shall not be exported.

[Example 4:

export module M;
struct S { int n; };
typedef S S;
export typedef S S;             // OK, does not redeclare an entity
export struct S;                // error: exported declaration follows non-exported declaration

— end example]

In the example, export typedef S S; redeclares a typedef-name whose preceding declaration was not exported. The normative wording seems to say that it's not OK, but the example says it is.

I guess the example needs to be updated.

The "or typedef-name" part of the normative wording was added by P1787R6.

cc @opensdh

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions