[clang] [llvm] Add macro to suppress -Wunnecessary-virtual-specifier (PR #139614)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Wed May 21 16:10:41 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-with-thin-lto-ubuntu` running on `as-worker-92` while building `clang,llvm` at step 6 "build-stage1-compiler".

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

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

```
Step 6 (build-stage1-compiler) failure: build (failure)
0.019 [6494/72/1] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ABIBreak.cpp.o
0.020 [6493/72/2] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/AutoConvert.cpp.o
0.021 [6492/72/3] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/COM.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/COM.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/include -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/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 -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/COM.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/COM.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/COM.cpp.o -c /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/COM.cpp
In file included from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/COM.h:17,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/COM.cpp:13:
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
0.032 [6492/71/4] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ExtensibleRTTI.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/ExtensibleRTTI.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/include -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/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 -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ExtensibleRTTI.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/ExtensibleRTTI.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ExtensibleRTTI.cpp.o -c /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/ExtensibleRTTI.cpp
In file included from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/ExtensibleRTTI.h:63,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/ExtensibleRTTI.cpp:9:
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
0.245 [6492/70/5] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DivisionByConstantInfo.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/DivisionByConstantInfo.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/include -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/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 -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/DivisionByConstantInfo.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/DivisionByConstantInfo.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/DivisionByConstantInfo.cpp.o -c /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/DivisionByConstantInfo.cpp
In file included from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/ADT/APInt.h:18,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/DivisionByConstantInfo.h:16,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/DivisionByConstantInfo.cpp:13:
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
0.357 [6492/69/6] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/BuryPointer.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/BuryPointer.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/include -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/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 -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/BuryPointer.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/BuryPointer.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/BuryPointer.cpp.o -c /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/BuryPointer.cpp
In file included from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/BuryPointer.h:12,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/BuryPointer.cpp:9:
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
0.395 [6492/68/7] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/DeltaTree.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/DeltaTree.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/include -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/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 -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/DeltaTree.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/DeltaTree.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/DeltaTree.cpp.o -c /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/DeltaTree.cpp
In file included from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/ADT/DeltaTree.h:16,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/DeltaTree.cpp:13:
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
0.414 [6492/67/8] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/build/stage1/include -I/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/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 -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/ConvertUTF.cpp.o -c /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/ConvertUTF.cpp
In file included from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/ConvertUTF.h:108,
                 from /home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/lib/Support/ConvertUTF.cpp:64:
/home/buildbot/as-worker-92/clang-with-thin-lto-ubuntu/llvm-project/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")

```

</details>

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


More information about the cfe-commits mailing list