Created on 2024-06-20.00:00:00 last changed yesterday
Proposed resolution (approved by CWG 2024-08-16):
Change in 10.2 [module.interface] paragraph 6 as follows:
A redeclaration of an entity X is implicitly exported if X was introduced by an exported declaration; otherwise it shall not be exported if it is attached to a named module.
Consider:
export module mod; extern "C++" void func(); export extern "C++" { void func(); }
Per 10.2 [module.interface] paragraph 6, this is currently ill-formed, but implementation treatment varies and there seems to be little rationale why this should be ill-formed for entities not attached to a named module.
The rule also makes the following example ill-formed, which was intended to be well-formed:
export module M; namespace N { // external linkage, attached to global module, not exported void f(); } namespace N { // error: exported namespace, redeclares non-exported namespace export void g(); }
The mental model here is that for an entity not attached to a named module, exportedness is not a meaningful property of that entity.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-11-19 12:36:26 | admin | set | status: tentatively ready -> ready |
2024-08-16 19:45:15 | admin | set | messages: + msg7799 |
2024-08-16 19:45:15 | admin | set | status: open -> tentatively ready |
2024-06-20 00:00:00 | admin | create |