[clang] [clang] Replace `finish()` with destructors for `DiagnosticConsumer` (PR #183831)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 13:00:19 PST 2026


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `amdgpu-offload-rhel-8-cmake-build-only` running on `rocm-docker-rhel-8` while building `clang` at step 4 "annotate".

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

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

```
Step 4 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py --jobs=32' (failure)
...
[8425/8482] Linking CXX executable tools/flang/unittests/Evaluate/intrinsics.test
[8426/8482] Linking CXX executable tools/flang/unittests/Evaluate/expression.test
[8427/8482] Linking CXX executable tools/flang/unittests/Evaluate/folding.test
[8428/8482] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXExtractAPI.cpp.o
[8429/8482] Linking CXX shared library lib/libclang.so.23.0.0git
[8430/8482] Creating library symlink lib/libclang.so.23.0git lib/libclang.so
[8431/8482] Linking CXX executable bin/c-index-test
[8432/8482] Linking CXX shared library lib/libFortranLower.so.23.0git
[8433/8482] Creating library symlink lib/libFortranLower.so
[8434/8482] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o
FAILED: tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DLLVM_BUILD_STATIC -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/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/tools/flang-driver -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/../clang/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-array-bounds -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -O3 -DNDEBUG -fno-semantic-interposition -std=c++17 -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o -MF tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o.d -o tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver/driver.cpp
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver/driver.cpp: In function ‘int main(int, const char**)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver/driver.cpp:224:22: error: ‘class clang::DiagnosticConsumer’ has no member named ‘finish’
   diags.getClient()->finish();
                      ^~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
[8435/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInstance.cpp.o
[8436/8482] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/fc1_main.cpp.o
[8437/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInvocation.cpp.o
[8438/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendAction.cpp.o
[8439/8482] Building CXX object tools/flang/lib/FrontendTool/CMakeFiles/flangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[8440/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.o
In file included from /usr/include/c++/8/cassert:43,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:40,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProfCorrelator.h:20,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/lib/Frontend/FrontendActions.cpp:61:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:1027: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
 
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:1036: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
 
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
[8441/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/ParserActions.cpp.o
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 62, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 53, in main
    run_command(["ninja"])
Step 7 (build cmake config) failure: build cmake config (failure)
...
[8425/8482] Linking CXX executable tools/flang/unittests/Evaluate/intrinsics.test
[8426/8482] Linking CXX executable tools/flang/unittests/Evaluate/expression.test
[8427/8482] Linking CXX executable tools/flang/unittests/Evaluate/folding.test
[8428/8482] Building CXX object tools/clang/tools/libclang/CMakeFiles/libclang.dir/CXExtractAPI.cpp.o
[8429/8482] Linking CXX shared library lib/libclang.so.23.0.0git
[8430/8482] Creating library symlink lib/libclang.so.23.0git lib/libclang.so
[8431/8482] Linking CXX executable bin/c-index-test
[8432/8482] Linking CXX shared library lib/libFortranLower.so.23.0git
[8433/8482] Creating library symlink lib/libFortranLower.so
[8434/8482] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o
FAILED: tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o 
ccache /usr/bin/c++ -DFLANG_INCLUDE_TESTS=1 -DLLVM_BUILD_STATIC -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/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/tools/flang-driver -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/flang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/../mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/mlir/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/include -isystem /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/../clang/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-array-bounds -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-ctad-maybe-unsupported -fno-semantic-interposition -O3 -DNDEBUG -fno-semantic-interposition -std=c++17 -UNDEBUG -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o -MF tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o.d -o tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver/driver.cpp
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver/driver.cpp: In function ‘int main(int, const char**)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/tools/flang-driver/driver.cpp:224:22: error: ‘class clang::DiagnosticConsumer’ has no member named ‘finish’
   diags.getClient()->finish();
                      ^~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
[8435/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInstance.cpp.o
[8436/8482] Building CXX object tools/flang/tools/flang-driver/CMakeFiles/flang.dir/fc1_main.cpp.o
[8437/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/CompilerInvocation.cpp.o
[8438/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendAction.cpp.o
[8439/8482] Building CXX object tools/flang/lib/FrontendTool/CMakeFiles/flangFrontendTool.dir/ExecuteCompilerInvocation.cpp.o
[8440/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/FrontendActions.cpp.o
In file included from /usr/include/c++/8/cassert:43,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:40,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProfCorrelator.h:20,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/flang/lib/Frontend/FrontendActions.cpp:61:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘llvm::ArrayRef<llvm::InstrProfValueSiteRecord> llvm::InstrProfRecord::getValueSitesForKind(uint32_t) const’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:1027: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
 
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h: In member function ‘std::vector<llvm::InstrProfValueSiteRecord>& llvm::InstrProfRecord::getOrCreateValueSitesForKind(uint32_t)’:
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ProfileData/InstrProf.h:1036: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
     assert(IPVK_First <= ValueKind && ValueKind <= IPVK_Last &&
 
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-ctad-maybe-unsupported’
cc1plus: warning: unrecognized command line option ‘-Wno-deprecated-copy’
[8441/8482] Building CXX object tools/flang/lib/Frontend/CMakeFiles/flangFrontend.dir/ParserActions.cpp.o
ninja: build stopped: subcommand failed.
['ninja'] exited with return code 1.
The build step threw an exception...
Traceback (most recent call last):
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 62, in step
    yield
  File "../llvm-zorg/zorg/buildbot/builders/annotated/amdgpu-offload-cmake.py", line 53, in main
    run_command(["ninja"])

```

</details>

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


More information about the cfe-commits mailing list