[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 11:09:17 PDT 2025


llvm-ci wrote:

LLVM Buildbot has detected a new failure on builder `clang-cmake-x86_64-avx512-linux` running on `avx512-intel64` while building `clang,llvm` at step 6 "build stage 1".

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

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

```
Step 6 (build stage 1) failure: 'ninja' (failure)
[1/4132] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/ABIBreak.cpp.o
[2/4132] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/AutoConvert.cpp.o
[3/4132] 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_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/include -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include -march=cascadelake -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 -UNDEBUG  -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 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/COM.cpp
In file included from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/COM.h:17,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/COM.cpp:13:
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
[4/4132] 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_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/include -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include -march=cascadelake -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 -UNDEBUG  -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 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/ExtensibleRTTI.cpp
In file included from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/ExtensibleRTTI.h:63,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/ExtensibleRTTI.cpp:9:
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
[5/4132] 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_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/include -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include -march=cascadelake -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 -UNDEBUG  -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 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/DivisionByConstantInfo.cpp
In file included from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/ADT/APInt.h:18,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/DivisionByConstantInfo.h:16,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/DivisionByConstantInfo.cpp:13:
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
[6/4132] 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_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/include -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include -march=cascadelake -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 -UNDEBUG  -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 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/BuryPointer.cpp
In file included from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/BuryPointer.h:12,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/BuryPointer.cpp:9:
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
[7/4132] 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_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/include -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include -march=cascadelake -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 -UNDEBUG  -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 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/DeltaTree.cpp
In file included from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/ADT/DeltaTree.h:16,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/DeltaTree.cpp:13:
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/Compiler.h:719:40: error: missing binary operator before token "("
  719 | #if defined(__clang__) && __has_warning("-Wunnecessary-virtual-specifier")
      |                                        ^
[8/4132] 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_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/stage1/include -I/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include -march=cascadelake -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 -UNDEBUG  -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 /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/ConvertUTF.cpp
In file included from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/include/llvm/Support/ConvertUTF.h:108,
                 from /localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/llvm/lib/Support/ConvertUTF.cpp:64:
/localdisk2/buildbot/llvm-worker/clang-cmake-x86_64-avx512-linux/llvm/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