[clang] Fix enum enumerator visibility loss when #include is between module imports (PR #188865)

MichaƂ Chojnowski via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 28 13:47:07 PDT 2026


https://github.com/michoecho commented:

@avikivity I see an undesired side effect: enum redefinition is no longer diagnosed if the first declaration was in a module.

Consider:
```c++
// modA.ccpm
module;
enum Enum {
    ENUM
};
export module modA;
```
```c++
// main.cc
import modA;
enum Enum {
    ENUM
};
enum Enum {
    ENUM
};
```

Before your change, this will (desirably) fail with a `error: redefinition of 'Enum'`. After your change, it will compile.

https://github.com/llvm/llvm-project/pull/188865


More information about the cfe-commits mailing list