[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
[module.interface]/6:
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