Skip to content

Commit 43651f2

Browse files
committed
C++26 モジュール宣言でのモジュール名のマクロ展開を禁止する : C++23でOKじゃなかった
1 parent 57d9fce commit 43651f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lang/cpp26/module_declarations_shouldnt_be_macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ C++26では、以下のようにモジュール名をマクロ (プリプロセ
2525
// lib.cppm:
2626
module;
2727
#include "version.h"
28-
export module VERSION; // C++23: OK, C++26: NG
28+
export module VERSION; // コンパイルエラー!
2929
```
3030

3131
この仕様は、C++20の欠陥として扱われる。そのため、C++20やC++23に対応したコンパイラですでに実装されている可能性がある。

0 commit comments

Comments
 (0)