[clang] [C++20][Modules] Implement P1857R3 Modules Dependency Discovery (PR #107168)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 9 23:55:03 PDT 2025
hubert-reinterpretcast wrote:
> I don't believe there will be issues there.
I think the caveat is "unless the implementation attempt finds problems" (which is all the more reason to try it).
The way the Core Issue resolution is worded, implementing it may prove to be difficult (depending on how the existing preprocessor is structured) because, once we interpret it as performing the check only after macros have been replaced, the interpretation starts down the path where the check is performed only after further directives are processed (which actually tracks with the intent that programs that are valid pre-P1857 remain valid unless they cause "dependency discovery" difficulties). For example:
**a.h:**
```cpp
;
```
**a.cppm:**
```cpp
export module a
#include "a.h"
```
Anyhow, even without throwing CWG2947 into the mix, stuff like this is allowed:
```cpp
export module x _Pragma("GCC warning \"Hi\"");
```
https://github.com/llvm/llvm-project/pull/107168
More information about the cfe-commits
mailing list