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

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 26 15:47:52 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 87168 tests passed
* 1344 tests skipped
* 1 test failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.PCH/cxx2a-compare.cpp</summary>

```
Exit Code: -11

Command Output (stdout):
--
# RUN: at line 1
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -emit-pch  /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -emit-pch /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp
# note: command had no output on stdout or stderr
# RUN: at line 2
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -include-pch /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -include-pch /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp -verify /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp
# note: command had no output on stdout or stderr
# RUN: at line 3
/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -include-pch /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp -o -
# executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -include-pch /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp -o -
# .---command stderr------------
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
# | Stack dump:
# | 0.	Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang -cc1 -internal-isystem /home/gha/actions-runner/_work/llvm-project/llvm-project/build/lib/clang/23/include -nostdsysteminc -pedantic-errors -std=c++2a -include-pch /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/PCH/Output/cxx2a-compare.cpp.tmp -emit-llvm /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp -o -
# | 1.	<eof> parser at end of file
# | 2.	Per-file LLVM IR generation
# | 3.	/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/PCH/cxx2a-compare.cpp:14:13: Generating code for declaration 'bar'
# |  #0 0x0000000009197328 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
# |  #1 0x0000000009194291 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
# |  #2 0x0000000009198141 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
# |  #3 0x0000000009197f98 __find_if<const int *, __gnu_cxx::__ops::_Iter_equals_val<const int> > /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algobase.h:2072:8
# |  #4 0x0000000009197f98 __find_if<const int *, __gnu_cxx::__ops::_Iter_equals_val<const int> > /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algobase.h:2117:14
# |  #5 0x0000000009197f98 find<const int *, int> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_algo.h:3897:14
# |  #6 0x0000000009197f98 is_contained<const int (&)[10], int> /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/STLExtras.h:1953:12
# |  #7 0x0000000009197f98 SignalHandlerTerminate(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:464:7
# |  #8 0x00007d8512794330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
# |  #9 0x000000000c38e156 isValueDependent /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/Expr.h:178:30
# | #10 0x000000000c38e156 clang::VarDecl::evaluateValueImpl(llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic>>&, bool) const /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/AST/Decl.cpp:2597:17
# | #11 0x000000000c38d97b clang::VarDecl::evaluateValue() const /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/AST/Decl.cpp:2589:10
# | #12 0x000000000c378fff isStruct /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/APValue.h:494:39
# | #13 0x000000000c378fff getStructField /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/APValue.h:668:12
# | #14 0x000000000c378fff clang::ComparisonCategoryInfo::ValueInfo::getIntValue() const /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/AST/ComparisonCategories.cpp:69:31
# | #15 0x000000000986ff89 getInt /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/IR/IRBuilder.h:538:29
# | #16 0x000000000986ff89 operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:1189:20
# | #17 0x000000000986ff89 (anonymous namespace)::AggExprEmitter::VisitBinCmp(clang::BinaryOperator const*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:1197:48
# | #18 0x000000000986cffb (anonymous namespace)::AggExprEmitter::Visit(clang::Expr*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:113:3
# | #19 0x000000000986ced4 Visit /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:113:3
# | #20 0x000000000986ced4 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGExprAgg.cpp:2174:49
# | #21 0x00000000096cb545 clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGStmt.cpp:0:7
# | #22 0x00000000096c75f1 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGStmt.cpp:461:5
# | #23 0x00000000096d5721 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CGStmt.cpp:575:10
# | #24 0x00000000096b1f66 EmitFunctionBody /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:0:5
# | #25 0x00000000096b1f66 clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenFunction.cpp:1620:5
# | #26 0x0000000009562cd2 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:6778:3
# | #27 0x000000000955a32f ~TimeTraceScope /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/TimeProfiler.h:200:9
# | #28 0x000000000955a32f clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:4780:3
# | #29 0x0000000009548af6 __normal_iterator /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h:1077:20
# | #30 0x0000000009548af6 begin /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:884:16
# | #31 0x0000000009548af6 empty /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:1089:16
# | #32 0x0000000009548af6 clang::CodeGen::CodeGenModule::EmitDeferred() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:3809:26
# | #33 0x000000000954522a clang::CodeGen::CodeGenModule::Release() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenModule.cpp:988:3
# | #34 0x0000000009ae1ffb (anonymous namespace)::CodeGeneratorImpl::HandleTranslationUnit(clang::ASTContext&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/ModuleBuilder.cpp:312:11
# | #35 0x0000000009ad9651 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:240:24
# | #36 0x000000000b4ec589 __normal_iterator /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_iterator.h:1077:20
# | #37 0x000000000b4ec589 begin /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_vector.h:874:16
# | #38 0x000000000b4ec589 finalize<std::vector<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> >, std::allocator<std::unique_ptr<clang::TemplateInstantiationCallback, std::default_delete<clang::TemplateInstantiationCallback> > > > > /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Sema/TemplateInstCallback.h:54:16
# | #39 0x000000000b4ec589 clang::ParseAST(clang::Sema&, bool, bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Parse/ParseAST.cpp:190:3
# | #40 0x000000000a046e46 clang::FrontendAction::Execute() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1346:10
# | #41 0x0000000009fa6fed getPtr /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Error.h:278:42
# | #42 0x0000000009fa6fed operator bool /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/Support/Error.h:241:16
# | #43 0x0000000009fa6fed clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:989:23
# | #44 0x000000000a13ebd8 get /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1666:16
# | #45 0x000000000a13ebd8 _M_get /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1363:66
# | #46 0x000000000a13ebd8 operator-> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1357:9
# | #47 0x000000000a13ebd8 getFrontendOpts /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Frontend/CompilerInstance.h:310:12
# | #48 0x000000000a13ebd8 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:319:14
# | #49 0x0000000006329995 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/tools/driver/cc1_main.cpp:302:15
# | #50 0x0000000006325775 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/tools/driver/driver.cpp:229:12
# | #51 0x0000000006324740 clang_main(int, char**, llvm::ToolContext const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/tools/driver/driver.cpp:277:12
# | #52 0x0000000006335ccd main /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/driver/clang-driver.cpp:17:10
# | #53 0x00007d85127791ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
# | #54 0x00007d851277928b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
# | #55 0x00000000063230e5 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/clang+0x63230e5)
# `-----------------------------
# error: command failed with exit status: -11

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list