Writing export ; or export static_assert(true); seems misguided and is devoid of any meaning possibly intended to be conveyed by the export. There is already a prohibition to export declarations of partial specializations.
CWG3185 wants to forbid such practices. Note that the braced form of export is left alone, i.e.
export { ; static_assert(true); }
continues to be well-formed.
There was a poll by EWG a few years ago in response to a C++23 NB comment that was called consensus for allowing export static_assert(true);, but that was actually with a majority of "neutral" voters. It's unclear why that was called consensus.
https://github.com/cplusplus/nbballot/issues/428#issuecomment-1310766777
It might also be desirable to have the set of restrictions for export and extern "C" (in both situations, without the braces only) to match.
Writing
export ;orexport static_assert(true);seems misguided and is devoid of any meaning possibly intended to be conveyed by theexport. There is already a prohibition to export declarations of partial specializations.CWG3185 wants to forbid such practices. Note that the braced form of
exportis left alone, i.e.continues to be well-formed.
There was a poll by EWG a few years ago in response to a C++23 NB comment that was called consensus for allowing
export static_assert(true);, but that was actually with a majority of "neutral" voters. It's unclear why that was called consensus.https://github.com/cplusplus/nbballot/issues/428#issuecomment-1310766777
It might also be desirable to have the set of restrictions for
exportandextern "C"(in both situations, without the braces only) to match.