Issue 131058
Summary Enum value name visibility issue with C++20 modules and GMF
Labels new issue
Assignees
Reporter kamrann
    Clang appears to have an issue with visibility of enums included into a module GMF.

```
// decls.h
enum {
 SomeName,
};
```
```
// module.mpp
module;

#include "decls.h"

export module mod;
```
```
// consumer.cpp
import mod;

auto a = SomeName;
```

This compiles without error - I believe incorrectly. Other implementations agree that `SomeName` is not in scope within `consumer.cpp`.
Note that Clang agrees with the other implementations under `-fmodules-reduced-bmi`. Presumably this implies that Clang is making the values visible to name lookup when the enum itself is reachable through the BMI. I couldn't find wording specifically for this case, but it certainly seems wrong intuitively.

See [compiler explorer repro](https://godbolt.org/z/oaTbGvnq6).

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to