Closed wg21bot closed 1 year ago
The wording change and associated notes does not seem to specify what happens if a non-name declaration is present in the declaration-seq of this grammar alternative:
export { declaration-seqopt }
Maybe this is stated in some unchanged wording, but as name-declaration is a new term I doubt it. There are two solutions I can think of:
I'm not fluent enough in modules yet to know which is more reasonable but at least 1 seems to not break any existing code. And static_asserts at least could be valuable to write inside such a declaration-seq.
Anyway, it might warrant a comment that only the name-declarations are actually exported.
1: export static_assert(true); // mild preference for bad 2: export {static_assert(true);} // strong preference for OK 3: export template void f(); // strong preference for bad 4: template export void f(); // strong preference for bad 5: export {template void f();} // strong preference for OK
Forward P2615R0 (CWG 2443 resolution) to CWG for inclusion in C++23 (Options 2-5 as preferred above, Option 1 still prohibited). | SF | F | N | A | SA |
---|---|---|---|---|---|
10 | 9 | 4 | 2 | 0 |
Result: Consensus
Additionally permit Option 1 above as proposed in D2715R0. | SF | F | N | A | SA |
---|---|---|---|---|---|
2 | 6 | 13 | 1 | 0 |
Result: Consensus
Resolved by https://github.com/cplusplus/papers/issues/1236 and D2715R0
See CWG2443
Accepted with Modifications. See P2615R1 for details.
The wording for export appears to allow various meaningless constructs, such as
template export void foo()
.A possible resolution is presented in P2615R0, but did not achieve consensus.