Open
Description
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.