[clang] [CodeGen] Add CodeGenModule::forgetDecl to discard cached mangled-name state (PR #234493)

via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 24 21:55:25 PDT 2026


github-actions[bot] wrote:

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

* 8278 tests passed
* 565 tests skipped

All executed tests passed, but another part of the build **failed**. Click on a failure below to see the details.

<details>
<summary>[code=1] tools/clang/lib/Interpreter/CMakeFiles/obj.clangInterpreter.dir/IncrementalParser.cpp.o</summary>

```
FAILED: [code=1] tools/clang/lib/Interpreter/CMakeFiles/obj.clangInterpreter.dir/IncrementalParser.cpp.o
sccache /opt/llvm/bin/clang++ -DCLANG_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/lib/Interpreter -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17 -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/clang/lib/Interpreter/CMakeFiles/obj.clangInterpreter.dir/IncrementalParser.cpp.o -MF tools/clang/lib/Interpreter/CMakeFiles/obj.clangInterpreter.dir/IncrementalParser.cpp.o.d -o tools/clang/lib/Interpreter/CMakeFiles/obj.clangInterpreter.dir/IncrementalParser.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:13:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.h:16:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/StringRef.h:12:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/DenseMapInfo.h:19:
In file included from /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/optional:47:
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/initializer_list:79:45: error: arithmetic on a pointer to an incomplete type 'const clang::GlobalDecl'
79 |       end() const noexcept { return begin() + size(); }
|                                     ~~~~~~~ ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:283:24: note: in instantiation of member function 'std::initializer_list<clang::GlobalDecl>::end' requested here
283 |     for (GlobalDecl GD : GDs)
|                        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:283:24: error: arithmetic on a pointer to an incomplete type 'const clang::GlobalDecl'
283 |     for (GlobalDecl GD : GDs)
|                        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:283:26: note: in implicit call to 'operator++' for iterator of type 'const_iterator' (aka 'const clang::GlobalDecl *')
283 |     for (GlobalDecl GD : GDs)
|                          ^~~
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/initializer_list:75:7: note: selected 'begin' function with iterator type 'const_iterator' (aka 'const clang::GlobalDecl *')
75 |       begin() const noexcept { return _M_array; }
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:283:21: error: variable has incomplete type 'GlobalDecl'
283 |     for (GlobalDecl GD : GDs)
|                     ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:298:25: error: 'GlobalDecl' is an incomplete type
298 |     forgetMangledNames({GlobalDecl(D)});
|                         ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:298:24: error: initialization of incomplete type 'GlobalDecl'
298 |     forgetMangledNames({GlobalDecl(D)});
|                        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:280:61: note: passing argument to parameter 'GDs' here
280 |   void forgetMangledNames(std::initializer_list<GlobalDecl> GDs) {
|                                                             ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:302:39: error: use of undeclared identifier 'Ctor_Complete'; did you mean 'TU_Complete'?
302 |     forgetMangledNames({GlobalDecl(D, Ctor_Complete), GlobalDecl(D, Ctor_Base),
|                                       ^~~~~~~~~~~~~
|                                       TU_Complete
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Basic/LangOptions.h:1204:3: note: 'TU_Complete' declared here
1204 |   TU_Complete,
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:302:25: error: invalid use of incomplete type 'GlobalDecl'
302 |     forgetMangledNames({GlobalDecl(D, Ctor_Complete), GlobalDecl(D, Ctor_Base),
|                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:302:69: error: use of undeclared identifier 'Ctor_Base'
302 |     forgetMangledNames({GlobalDecl(D, Ctor_Complete), GlobalDecl(D, Ctor_Base),
|                                                                     ^~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:303:39: error: use of undeclared identifier 'Ctor_Comdat'
303 |                         GlobalDecl(D, Ctor_Comdat)});
|                                       ^~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:308:24: error: use of undeclared identifier 'Dtor_Deleting'
308 |         {GlobalDecl(D, Dtor_Deleting), GlobalDecl(D, Dtor_Complete),
|                        ^~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:308:54: error: use of undeclared identifier 'Dtor_Complete'; did you mean 'TU_Complete'?
308 |         {GlobalDecl(D, Dtor_Deleting), GlobalDecl(D, Dtor_Complete),
|                                                      ^~~~~~~~~~~~~
|                                                      TU_Complete
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Basic/LangOptions.h:1204:3: note: 'TU_Complete' declared here
1204 |   TU_Complete,
|   ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:308:40: error: invalid use of incomplete type 'GlobalDecl'
308 |         {GlobalDecl(D, Dtor_Deleting), GlobalDecl(D, Dtor_Complete),
|                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:309:24: error: use of undeclared identifier 'Dtor_Base'
309 |          GlobalDecl(D, Dtor_Base), GlobalDecl(D, Dtor_Comdat)});
|                        ^~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:309:50: error: use of undeclared identifier 'Dtor_Comdat'
309 |          GlobalDecl(D, Dtor_Base), GlobalDecl(D, Dtor_Comdat)});
|                                                  ^~~~~~~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:316:25: error: 'GlobalDecl' is an incomplete type
316 |     forgetMangledNames({GlobalDecl(D)});
|                         ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:316:24: error: initialization of incomplete type 'GlobalDecl'
316 |     forgetMangledNames({GlobalDecl(D)});
|                        ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/AST/ASTContext.h:105:7: note: forward declaration of 'clang::GlobalDecl'
105 | class GlobalDecl;
|       ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Interpreter/IncrementalParser.cpp:280:61: note: passing argument to parameter 'GDs' here
280 |   void forgetMangledNames(std::initializer_list<GlobalDecl> GDs) {
|                                                             ^
16 errors generated.
```
</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/234493


More information about the cfe-commits mailing list