Created on 2026-04-28.00:00:00 last changed 2 days ago
Additional notes (2026-05-30)
Forwarded to EWG with paper issue #2802 for considering the design direction.
Proposed resolution (May, 2026):
Change in 10.2 [module.interface] paragraph 1 as follows:
An export-declaration shall inhabit a namespace scope and appear in the purview of a module interface unit. An export-declaration shall not appear directly or indirectly within an unnamed namespace or a private-module-fragment. An export-declaration has the declarative effects of its name-declaration, declaration-seq (if any), or module-import-declaration. The name-declaration of an export-declaration shallnotneitherThe declaration-seq of an export-declaration shall not contain an export-declaration or module-import-declaration.
- be a static_assert-declaration, consteval-block-declaration, or empty-declaration, nor
- declare a partial specialization (13.7.1 [temp.decls.general]).
(From submission #894.)
Consider:
export static_assert(true);
This is syntactically valid, because export is followed by a name-declaration per 10.2 [module.interface] paragraph 1. One option for name-declaration is block-declaration (see 9.1 [dcl.pre] paragraph 1). One option for block-declaration is static_assert-declaration.
However, the additional export is entirely meaningless. Similar concerns apply to consteval-block-declaration and empty-declaration.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2026-05-30 06:06:38 | admin | set | messages: + msg8587 |
| 2026-05-20 07:13:21 | admin | set | messages: + msg8586 |
| 2026-05-20 07:13:21 | admin | set | status: open -> review |
| 2026-04-28 00:00:00 | admin | create | |