[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:23:54 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `llvm-clang-x86_64-sie-ubuntu-fast` running on `sie-linux-worker` while building `clang-tools-extra,clang` at step 6 "test-build-unified-tree-check-all".

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

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

```
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
...
22.095 [258/34/27] Linking CXX executable tools/clang/tools/extra/unittests/clang-query/ClangQueryTests
22.187 [257/34/28] Building CXX object tools/clang/tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/ClangTidyDiagnosticConsumerTest.cpp.o
22.960 [256/34/29] Building CXX object tools/clang/tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/DeclRefExprUtilsTest.cpp.o
23.127 [255/34/30] Building CXX object tools/clang/tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/IncludeCleanerTest.cpp.o
23.547 [254/34/31] Building CXX object tools/clang/tools/extra/unittests/clang-move/CMakeFiles/ClangMoveTests.dir/ClangMoveTests.cpp.o
24.166 [253/34/32] Linking CXX executable tools/clang/tools/extra/unittests/clang-include-fixer/find-all-symbols/FindAllSymbolsTests
24.410 [252/34/33] Building CXX object tools/clang/tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/LLVMModuleTest.cpp.o
24.545 [251/34/34] Building CXX object tools/clang/tools/extra/unittests/clang-change-namespace/CMakeFiles/ClangChangeNamespaceTests.dir/ChangeNamespaceTests.cpp.o
24.848 [250/34/35] Building CXX object tools/clang/tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/IncludeInserterTest.cpp.o
25.382 [249/34/36] 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_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/g++ -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/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/clang/unittests/Parse -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/unittests/Parse -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/include -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/tools/clang/include -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/build/include -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/include -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include -I/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/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/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp
In file included from /usr/include/c++/11/memory:76,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/llvm/include/llvm/Support/Casting.h:20,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/include/clang/Basic/LLVM.h:21,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/include/clang/Basic/DiagnosticIDs.h:18,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/include/clang/Basic/Diagnostic.h:17,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/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/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/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/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang/unittests/Parse/ParseHLSLRootSignatureTest.cpp:20:
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/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/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/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,
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
25.942 [249/33/37] Linking CXX executable tools/clang/tools/extra/unittests/clang-move/ClangMoveTests
26.074 [249/32/38] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/ModuleDeclStateTest.cpp.o
26.176 [249/31/39] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/PPMemoryAllocationsTest.cpp.o
26.265 [249/30/40] Building CXX object tools/clang/unittests/Basic/CMakeFiles/BasicTests.dir/SourceManagerTest.cpp.o
26.583 [249/29/41] Building CXX object tools/clang/unittests/Lex/CMakeFiles/LexTests.dir/PPConditionalDirectiveRecordTest.cpp.o
26.652 [249/28/42] Building CXX object tools/clang/tools/extra/unittests/clang-tidy/CMakeFiles/ClangTidyTests.dir/ModernizeModuleTest.cpp.o
In file included from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/gtest-param-test.h:181,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/gtest.h:68,
                 from /home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/clang-tools-extra/unittests/clang-tidy/ModernizeModuleTest.cpp:11:
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h: In instantiation of ‘class testing::internal::ParameterizedTestFactory<clang::tidy::test::SizeTest_TokenSize_Test>’:
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h:445:12:   required from ‘testing::internal::TestFactoryBase* testing::internal::TestMetaFactory<TestSuite>::CreateTestFactory(testing::internal::TestMetaFactory<TestSuite>::ParamType) [with TestSuite = clang::tidy::test::SizeTest_TokenSize_Test; testing::internal::TestMetaFactory<TestSuite>::ParamType = clang::tidy::test::{anonymous}::SizeParam]’
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h:444:20:   required from here
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h:399:7: warning: ‘testing::internal::ParameterizedTestFactory<clang::tidy::test::SizeTest_TokenSize_Test>’ has a field ‘testing::internal::ParameterizedTestFactory<clang::tidy::test::SizeTest_TokenSize_Test>::parameter_’ whose type uses the anonymous namespace [-Wsubobject-linkage]
  399 | class ParameterizedTestFactory : public TestFactoryBase {
      |       ^~~~~~~~~~~~~~~~~~~~~~~~
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h: In instantiation of ‘class testing::internal::ParameterizedTestFactory<clang::tidy::test::MatcherTest_MatchResult_Test>’:
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h:445:12:   required from ‘testing::internal::TestFactoryBase* testing::internal::TestMetaFactory<TestSuite>::CreateTestFactory(testing::internal::TestMetaFactory<TestSuite>::ParamType) [with TestSuite = clang::tidy::test::MatcherTest_MatchResult_Test; testing::internal::TestMetaFactory<TestSuite>::ParamType = clang::tidy::test::{anonymous}::MatchParam]’
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h:444:20:   required from here
/home/buildbot/buildbot-root/llvm-clang-x86_64-sie-ubuntu-fast/llvm-project/third-party/unittest/googletest/include/gtest/internal/gtest-param-util.h:399:7: warning: ‘testing::internal::ParameterizedTestFactory<clang::tidy::test::MatcherTest_MatchResult_Test>’ has a field ‘testing::internal::ParameterizedTestFactory<clang::tidy::test::MatcherTest_MatchResult_Test>::parameter_’ whose type uses the anonymous namespace [-Wsubobject-linkage]

```

</details>

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


More information about the cfe-commits mailing list