[clang] [clang-tools-extra] [clang] Do not share ownership of `PreprocessorOptions` (PR #133467)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 4 10:31:54 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `openmp-offload-amdgpu-runtime-2` running on `rocm-worker-hw-02` while building `clang-tools-extra,clang` at step 7 "Add check check-clang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/10/builds/2836

<details>
<summary>Here is the relevant piece of the build log for the reference</summary>

```
Step 7 (Add check check-clang) failure: test (failure)
...
[25/313] Linking CXX shared library lib/libLLVMTestingSupport.so.21.0git
[26/313] Creating library symlink lib/libLLVMTestingAnnotations.so
[27/313] Creating library symlink lib/libLLVMTestingSupport.so
[28/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/Z3CrosscheckOracleTest.cpp.o
[29/313] Building CXX object tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ModuleCacheTest.cpp.o
[30/313] Building CXX object tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/GCCVersionTest.cpp.o
[31/313] Building CXX object tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/MultilibTest.cpp.o
[32/313] Building CXX object tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/MultilibBuilderTest.cpp.o
[33/313] Building CXX object tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/SanitizerArgsTest.cpp.o
[34/313] Building CXX object tools/clang/unittests/Parse/CMakeFiles/ParseTests.dir/ParseHLSLRootSignatureTest.cpp.o
FAILED: tools/clang/unittests/Parse/CMakeFiles/ParseTests.dir/ParseHLSLRootSignatureTest.cpp.o 
ccache /usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/unittests/Parse -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/unittests/Parse -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/tools/clang/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.build/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/third-party/unittest/googletest/include -I/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -std=c++17 -MD -MT tools/clang/unittests/Parse/CMakeFiles/ParseTests.dir/ParseHLSLRootSignatureTest.cpp.o -MF tools/clang/unittests/Parse/CMakeFiles/ParseTests.dir/ParseHLSLRootSignatureTest.cpp.o.d -o tools/clang/unittests/Parse/CMakeFiles/ParseTests.dir/ParseHLSLRootSignatureTest.cpp.o -c /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp
In file included from /usr/include/c++/11/memory:76,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/llvm/include/llvm/Support/Casting.h:20,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include/clang/Basic/LLVM.h:21,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include/clang/Basic/DiagnosticIDs.h:18,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include/clang/Basic/Diagnostic.h:17,
                 from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp:9:
/usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = clang::Preprocessor; _Args = {std::shared_ptr<clang::PreprocessorOptions>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::HeaderSearch&, clang::TrivialModuleLoader&, std::nullptr_t, bool}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<clang::Preprocessor>]’:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp:87:70:   required from here
/usr/include/c++/11/bits/unique_ptr.h:962:30: error: no matching function for call to ‘clang::Preprocessor::Preprocessor(std::shared_ptr<clang::PreprocessorOptions>, clang::DiagnosticsEngine&, clang::LangOptions&, clang::SourceManager&, clang::HeaderSearch&, clang::TrivialModuleLoader&, std::nullptr_t, bool)’
  962 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp:20:
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include/clang/Lex/Preprocessor.h:1168:3: note: candidate: ‘clang::Preprocessor::Preprocessor(const clang::PreprocessorOptions&, clang::DiagnosticsEngine&, const clang::LangOptions&, clang::SourceManager&, clang::HeaderSearch&, clang::ModuleLoader&, clang::IdentifierInfoLookup*, bool, clang::TranslationUnitKind)’
 1168 |   Preprocessor(const PreprocessorOptions &PPOpts, DiagnosticsEngine &diags,
      |   ^~~~~~~~~~~~
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/clang/include/clang/Lex/Preprocessor.h:1168:43: note:   no known conversion for argument 1 from ‘std::shared_ptr<clang::PreprocessorOptions>’ to ‘const clang::PreprocessorOptions&’
 1168 |   Preprocessor(const PreprocessorOptions &PPOpts, DiagnosticsEngine &diags,
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
[35/313] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/PPMemoryAllocationsTest.cpp.o
[36/313] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/PPConditionalDirectiveRecordTest.cpp.o
[37/313] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/ModuleDeclStateTest.cpp.o
[38/313] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/PPDependencyDirectivesTest.cpp.o
[39/313] Building CXX object tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/SourceManagerTest.cpp.o
[40/313] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/LexerTest.cpp.o
[41/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/APSIntTypeTest.cpp.o
[42/313] Building CXX object tools/clang/lib/Testing/CMakeFiles/clangTesting.dir/TestAST.cpp.o
[43/313] Building CXX object tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/DXCModeTest.cpp.o
[44/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/ObjcBug-124477.cpp.o
[45/313] Building CXX object tools/clang/unittests/Analysis/CMakeFiles/ClangAnalysisTests.dir/CloneDetectionTest.cpp.o
[46/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/CallEventTest.cpp.o
[47/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/TestReturnValueUnderConstruction.cpp.o
[48/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/ConflictingEvalCallsTest.cpp.o
[49/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/SValSimplifyerTest.cpp.o
[50/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/MemRegionDescriptiveNameTest.cpp.o
[51/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/NoStateChangeFuncVisitorTest.cpp.o
[52/313] Building CXX object tools/clang/unittests/StaticAnalyzer/CMakeFiles/StaticAnalysisTests.dir/ExprEngineVisitTest.cpp.o
[53/313] Building CXX object tools/clang/unittests/Analysis/CMakeFiles/ClangAnalysisTests.dir/MacroExpansionContextTest.cpp.o

```

</details>

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


More information about the cfe-commits mailing list