[clang] [clang] Extend -Wunused-but-set-variable to static globals (PR #178342)

via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 14 20:26:50 PST 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 3043 tests passed
* 29 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=4294967295] bin/libclang.dll lib/libclang.lib</summary>

```
FAILED: [code=4294967295] bin/libclang.dll lib/libclang.lib
cmd.exe /C "cd . && C:\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -E vs_link_dll --intdir=tools\clang\tools\libclang\CMakeFiles\libclang.dir --rc="C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe" --mt="C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\mt.exe" --manifests  -- C:\clang\clang-msvc\bin\lld-link.exe /nologo @CMakeFiles\libclang.rsp  /out:bin\libclang.dll /implib:lib\libclang.lib /pdb:bin\libclang.pdb /dll /version:23.0 /MANIFEST:NO /INCREMENTAL:NO  && cd ."
LINK: command "C:\clang\clang-msvc\bin\lld-link.exe /nologo @CMakeFiles\libclang.rsp /out:bin\libclang.dll /implib:lib\libclang.lib /pdb:bin\libclang.pdb /dll /version:23.0 /MANIFEST:NO /INCREMENTAL:NO" failed (exit code 1) with the following output:
lld-link: error: undefined symbol: public: bool __cdecl llvm::remarks::RemarkStreamer::needsSection(void) const
>>> referenced by LLVMAsmPrinter.lib(AsmPrinter.cpp.obj):(public: void __cdecl llvm::AsmPrinter::emitRemarksSection(class llvm::remarks::RemarkStreamer &))

lld-link: error: undefined symbol: public: __cdecl llvm::remarks::RemarkStreamer::~RemarkStreamer(void)
>>> referenced by LLVMCore.lib(LLVMContext.cpp.obj):(public: void __cdecl llvm::LLVMContext::setMainRemarkStreamer(class std::unique_ptr<class llvm::remarks::RemarkStreamer, struct std::default_delete<class llvm::remarks::RemarkStreamer>>))
>>> referenced by LLVMCore.lib(LLVMContext.cpp.obj):(public: void __cdecl llvm::LLVMContext::setMainRemarkStreamer(class std::unique_ptr<class llvm::remarks::RemarkStreamer, struct std::default_delete<class llvm::remarks::RemarkStreamer>>))
>>> referenced by LLVMCore.lib(LLVMContextImpl.cpp.obj):(public: __cdecl llvm::LLVMContextImpl::~LLVMContextImpl(void))
>>> referenced 2 more times

lld-link: error: undefined symbol: public: bool __cdecl llvm::remarks::RemarkStreamer::matchesFilter(class llvm::StringRef)
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(public: void __cdecl llvm::LLVMRemarkStreamer::emit(class llvm::DiagnosticInfoOptimizationBase const &))

lld-link: error: undefined symbol: class llvm::Expected<enum llvm::remarks::Format> __cdecl llvm::remarks::parseFormat(class llvm::StringRef)
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Expected<class llvm::LLVMRemarkFileHandle> __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::StringRef, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Error __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::raw_ostream &, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))

lld-link: error: undefined symbol: class llvm::Expected<class std::unique_ptr<struct llvm::remarks::RemarkSerializer, struct std::default_delete<struct llvm::remarks::RemarkSerializer>>> __cdecl llvm::remarks::createRemarkSerializer(enum llvm::remarks::Format, class llvm::raw_ostream &)
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Expected<class llvm::LLVMRemarkFileHandle> __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::StringRef, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Error __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::raw_ostream &, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))

lld-link: error: undefined symbol: public: __cdecl llvm::remarks::RemarkStreamer::RemarkStreamer(class std::unique_ptr<struct llvm::remarks::RemarkSerializer, struct std::default_delete<struct llvm::remarks::RemarkSerializer>>, class std::optional<class llvm::StringRef>)
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Expected<class llvm::LLVMRemarkFileHandle> __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::StringRef, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Error __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::raw_ostream &, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))

lld-link: error: undefined symbol: public: class llvm::Error __cdecl llvm::remarks::RemarkStreamer::setFilter(class llvm::StringRef)
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Expected<class llvm::LLVMRemarkFileHandle> __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::StringRef, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))
>>> referenced by LLVMCore.lib(LLVMRemarkStreamer.cpp.obj):(class llvm::Error __cdecl llvm::setupLLVMOptimizationRemarks(class llvm::LLVMContext &, class llvm::raw_ostream &, class llvm::StringRef, class llvm::StringRef, bool, class std::optional<unsigned __int64>))
```
</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/178342


More information about the cfe-commits mailing list