llvm-project/clang/test/Modules/include-after-imports-enums.cppm
Chuanqi Xu fccc6ee702 [C++20] [Modules] Don't make enum constant members always visible
Close https://github.com/llvm/llvm-project/issues/131058

See the comments in
ASTWriter.cpp:ASTDeclContextNameLookupTrait::getLookupVisibility and
SemaLookup.cpp:Sema::makeMergedDefinitionVisible for details.
2025-06-23 14:39:08 +08:00

26 lines
597 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-module-interface -o %t/M.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fprebuilt-module-path=%t -verify -fsyntax-only
//
// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-reduced-module-interface -o %t/M.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fprebuilt-module-path=%t -verify -fsyntax-only
//--- enum.h
enum E { Value };
//--- M.cppm
module;
#include "enum.h"
export module M;
auto e = Value;
//--- use.cpp
// expected-no-diagnostics
import M;
#include "enum.h"
auto e = Value;