[clang] [clang-tools-extra] Fix OOM in FormatDiagnostic (PR #108187)
LLVM Continuous Integration via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 16 08:11:49 PDT 2024
llvm-ci wrote:
LLVM Buildbot has detected a new failure on builder `clang-x86_64-debian-fast` running on `gribozavr4` 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/56/builds/7472
<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)
...
In file included from /b/1/clang-x86_64-debian-fast/llvm.src/clang/unittests/Analysis/FlowSensitive/ASTOpsTest.cpp:10:
In file included from /b/1/clang-x86_64-debian-fast/llvm.src/clang/unittests/Analysis/FlowSensitive/TestingSupport.h:41:
In file included from /b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Tooling/Tooling.h:35:
In file included from /b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Frontend/FrontendAction.h:23:
In file included from /b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Frontend/ASTUnit.h:28:
/b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Sema/CodeCompleteConsumer.h:338:31: warning: '@class' command should not be used in a comment attached to a non-class declaration [-Wdocumentation]
/// Code completion in a @class forward declaration.
~^~~~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
28.965 [922/98/166] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/ConfigCompileTests.cpp.o
FAILED: tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/ConfigCompileTests.cpp.o
CCACHE_CPP2=yes CCACHE_HASHDIR=yes /usr/bin/ccache /usr/bin/clang++ -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/b/1/clang-x86_64-debian-fast/llvm.obj/tools/clang/tools/extra/clangd/unittests -I/b/1/clang-x86_64-debian-fast/llvm.src/clang-tools-extra/clangd/unittests -I/b/1/clang-x86_64-debian-fast/llvm.src/clang-tools-extra/clangd/../include-cleaner/include -I/b/1/clang-x86_64-debian-fast/llvm.obj/tools/clang/tools/extra/clangd/../clang-tidy -I/b/1/clang-x86_64-debian-fast/llvm.src/clang/include -I/b/1/clang-x86_64-debian-fast/llvm.obj/tools/clang/include -I/b/1/clang-x86_64-debian-fast/llvm.obj/include -I/b/1/clang-x86_64-debian-fast/llvm.src/llvm/include -I/b/1/clang-x86_64-debian-fast/llvm.src/clang-tools-extra/clangd -I/b/1/clang-x86_64-debian-fast/llvm.obj/tools/clang/tools/extra/clangd -I/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include -I/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googlemock/include -std=c++11 -Wdocumentation -Wno-documentation-deprecated-sync -fPIC -fvisibility-inlines-hidden -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 -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -std=c++17 -MD -MT tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/ConfigCompileTests.cpp.o -MF tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/ConfigCompileTests.cpp.o.d -o tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/ConfigCompileTests.cpp.o -c /b/1/clang-x86_64-debian-fast/llvm.src/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp
/b/1/clang-x86_64-debian-fast/llvm.src/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp:308:9: error: no matching constructor for initialization of 'Diag' (aka 'clang::Diagnostic')
Diag{&DiagEngine}, Conf.Diagnostics.Suppress, LangOptions()));
^ ~~~~~~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include/gtest/gtest.h:1807:50: note: expanded from macro 'EXPECT_TRUE'
#define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition)
^~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include/gtest/gtest.h:1792:23: note: expanded from macro 'GTEST_EXPECT_TRUE'
GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
^~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h:1493:38: note: expanded from macro 'GTEST_TEST_BOOLEAN_'
::testing::AssertionResult(expression)) \
^~~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Basic/Diagnostic.h:1487:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'clang::DiagnosticsEngine *' to 'const clang::Diagnostic' for 1st argument
class Diagnostic {
^
/b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Basic/Diagnostic.h:1487:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'clang::DiagnosticsEngine *' to 'clang::Diagnostic' for 1st argument
/b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Basic/Diagnostic.h:1496:3: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
Diagnostic(const DiagnosticsEngine *DO, const DiagnosticBuilder &DiagBuilder);
^
/b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Basic/Diagnostic.h:1497:3: note: candidate constructor not viable: requires 5 arguments, but 1 was provided
Diagnostic(const DiagnosticsEngine *DO, SourceLocation DiagLoc,
^
/b/1/clang-x86_64-debian-fast/llvm.src/clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp:314:9: error: no matching constructor for initialization of 'Diag' (aka 'clang::Diagnostic')
Diag{&DiagEngine}, Conf.Diagnostics.Suppress, LangOptions()));
^ ~~~~~~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include/gtest/gtest.h:1811:52: note: expanded from macro 'EXPECT_FALSE'
#define EXPECT_FALSE(condition) GTEST_EXPECT_FALSE(condition)
^~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include/gtest/gtest.h:1795:25: note: expanded from macro 'GTEST_EXPECT_FALSE'
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
^~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/third-party/unittest/googletest/include/gtest/internal/gtest-internal.h:1493:38: note: expanded from macro 'GTEST_TEST_BOOLEAN_'
::testing::AssertionResult(expression)) \
^~~~~~~~~~
/b/1/clang-x86_64-debian-fast/llvm.src/clang/include/clang/Basic/Diagnostic.h:1487:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'clang::DiagnosticsEngine *' to 'const clang::Diagnostic' for 1st argument
class Diagnostic {
^
```
</details>
https://github.com/llvm/llvm-project/pull/108187
More information about the cfe-commits
mailing list