概要
C++20時点でのモジュール定義では、いくつかの不必要なexport宣言ができてしまっていた。
template export void f();
export template void f();
export template<> void g(int);
template<> export void g(int);
export template<class T> struct trait<T*>;
C++23では、本来必要のない以下の宣言に対するexport宣言を禁止する:
- 明示的なインスタンス化
- 明示的な特殊化
- export宣言
ただし、この変更のあとでも、export { … }
で囲まれた中では、これらが含まれていてもコンパイルエラーにはならない。