You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CWG3185 [decl.pre] static_assertion-declarations should not be name-declarations #894
Issue description: In the current wording, block-declaration includes static_assertion-declarations, and name-declarations include block-declaration, while [module.interface] considers all name-declarations as eligible to be declared as export. Therefore, static_assert-declarations are allowed to be declared as export.
changed the title [-][decl.pre] static_assertion-declarations should not be named-declarations[/-][+][decl.pre] static_assertion-declarations should not be name-declarations[/+]on Apr 28, 2026
changed the title [-][decl.pre] static_assertion-declarations should not be name-declarations[/-][+]CWG3185 [decl.pre] static_assertion-declarations should not be name-declarations[/+]on May 2, 2026
is well-formed according to our grammar, and no rule appears to make them ill-formed; the linkage semantics just have nothing meaningful to apply to.
For consistency (and also because extern static_assert is equally bonkers as export static_assert), we should make these ill-formed as well.
GCC and Clang are compliant, while MSVC and EDG rejects extern "C" [[attribute]]. externing a consteval block works on GCC 16.1 as it has reflection support.
Proposed resolution for the export also makes export asm-declaration ill-formed, but I am not certain if extern asm-declaration should also be made ill-formed.
Not sure whether this should be a new issue or considered as part of this one. Let me know if this needs to be its own issue and we don't consider the usecases above as NAD. If so I can open up a new issue for restricting the linkage-specification.
Activity
[-][decl.pre] static_assertion-declarations should not be named-declarations[/-][+][decl.pre] static_assertion-declarations should not be name-declarations[/+]jensmaurer commentedon May 2, 2026
CWG3185
[-][decl.pre] static_assertion-declarations should not be name-declarations[/-][+]CWG3185 [decl.pre] static_assertion-declarations should not be name-declarations[/+]term-est commentedon Jun 19, 2026
linkage-specification: is in the form of:
extern unevaluated-string name-declarationThis has the side effect that:
is well-formed according to our grammar, and no rule appears to make them ill-formed; the linkage semantics just have nothing meaningful to apply to.
For consistency (and also because
extern static_assertis equally bonkers asexport static_assert), we should make these ill-formed as well.GCC and Clang are compliant, while MSVC and EDG rejects
extern "C" [[attribute]]. externing a consteval block works on GCC 16.1 as it has reflection support.Proposed resolution for the
exportalso makesexport asm-declarationill-formed, but I am not certain ifextern asm-declarationshould also be made ill-formed.Not sure whether this should be a new issue or considered as part of this one. Let me know if this needs to be its own issue and we don't consider the usecases above as NAD. If so I can open up a new issue for restricting the
linkage-specification.