[clang] [llvm] [clang] Add scoped enum support to `StreamingDiagnostic` (PR #138089)

LLVM Continuous Integration via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 06:27:01 PDT 2025


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,llvm` at step 4 "annotate".

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

<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)
...
[4113/7793] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesTypes.cpp.o
[4114/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ASTSourceDescriptor.cpp.o
[4115/7793] Building CXX object tools/mlir/lib/Tools/mlir-translate/CMakeFiles/obj.MLIRTranslateLib.dir/MlirTranslateMain.cpp.o
[4116/7793] Building CXX object tools/mlir/lib/Tools/tblgen-lsp-server/CMakeFiles/TableGenLspServerLib.dir/LSPServer.cpp.o
[4117/7793] Building CXX object tools/mlir/examples/minimal-opt/CMakeFiles/mlir-cat.dir/mlir-cat.cpp.o
[4118/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/CodeGenOptions.cpp.o
[4119/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OperatorPrecedence.cpp.o
[4120/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/FileEntry.cpp.o
[4121/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/MakeSupport.cpp.o
[4122/7793] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o
FAILED: tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o 
ccache /usr/bin/c++ -DCLANG_EXPORTS -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/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/lib/Lex -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Lex -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/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 -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-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o -MF tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o.d -o tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Lex/DependencyDirectivesScanner.cpp
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/ADL.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/Hashing.h:47,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/CustomizableOptional.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/FileEntry.h:17,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/SourceLocation.h:17,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Lex/DependencyDirectivesScanner.h:20,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Lex/DependencyDirectivesScanner.cpp:17:
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const clang::SourceRange>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const clang::SourceRange]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = clang::StreamingDiagnostic; U = const clang::SourceRange&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1490:12:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const clang::SourceRange’ is not an enumeration type
       typedef __underlying_type(_Tp) type;
                                      ^~~~
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const clang::CharSourceRange>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const clang::CharSourceRange]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = clang::StreamingDiagnostic; U = const clang::CharSourceRange&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1498:12:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const clang::CharSourceRange’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const clang::FixItHint>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const clang::FixItHint]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = clang::StreamingDiagnostic; U = const clang::FixItHint&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1505:12:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const clang::FixItHint’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const char [18]>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const char [18]]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = llvm::raw_fd_ostream; U = const char (&)[18]]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/LangOptions.h:1194:21:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const char [18]’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const unsigned int>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const unsigned int]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = llvm::raw_ostream; U = const unsigned int&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/LangOptions.h:1194:45:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const unsigned int’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const char [24]>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const char [24]]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = llvm::raw_ostream; U = const char (&)[24]]’
Step 7 (build cmake config) failure: build cmake config (failure)
...
[4113/7793] Building CXX object tools/clang/lib/APINotes/CMakeFiles/obj.clangAPINotes.dir/APINotesTypes.cpp.o
[4114/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/ASTSourceDescriptor.cpp.o
[4115/7793] Building CXX object tools/mlir/lib/Tools/mlir-translate/CMakeFiles/obj.MLIRTranslateLib.dir/MlirTranslateMain.cpp.o
[4116/7793] Building CXX object tools/mlir/lib/Tools/tblgen-lsp-server/CMakeFiles/TableGenLspServerLib.dir/LSPServer.cpp.o
[4117/7793] Building CXX object tools/mlir/examples/minimal-opt/CMakeFiles/mlir-cat.dir/mlir-cat.cpp.o
[4118/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/CodeGenOptions.cpp.o
[4119/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/OperatorPrecedence.cpp.o
[4120/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/FileEntry.cpp.o
[4121/7793] Building CXX object tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/MakeSupport.cpp.o
[4122/7793] Building CXX object tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o
FAILED: tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o 
ccache /usr/bin/c++ -DCLANG_EXPORTS -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/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/lib/Lex -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Lex -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include -I/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/build/tools/clang/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 -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-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -Wno-misleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o -MF tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o.d -o tools/clang/lib/Lex/CMakeFiles/obj.clangLex.dir/DependencyDirectivesScanner.cpp.o -c /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Lex/DependencyDirectivesScanner.cpp
In file included from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/ADL.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/llvm/include/llvm/ADT/Hashing.h:47,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/CustomizableOptional.h:12,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/FileEntry.h:17,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/SourceLocation.h:17,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Lex/DependencyDirectivesScanner.h:20,
                 from /home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/lib/Lex/DependencyDirectivesScanner.cpp:17:
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const clang::SourceRange>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const clang::SourceRange]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = clang::StreamingDiagnostic; U = const clang::SourceRange&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1490:12:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const clang::SourceRange’ is not an enumeration type
       typedef __underlying_type(_Tp) type;
                                      ^~~~
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const clang::CharSourceRange>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const clang::CharSourceRange]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = clang::StreamingDiagnostic; U = const clang::CharSourceRange&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1498:12:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const clang::CharSourceRange’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const clang::FixItHint>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const clang::FixItHint]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = clang::StreamingDiagnostic; U = const clang::FixItHint&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1505:12:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const clang::FixItHint’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const char [18]>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const char [18]]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = llvm::raw_fd_ostream; U = const char (&)[18]]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/LangOptions.h:1194:21:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const char [18]’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const unsigned int>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const unsigned int]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = llvm::raw_ostream; U = const unsigned int&]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/LangOptions.h:1194:45:   required from here
/usr/include/c++/8/type_traits:2002:38: error: ‘const unsigned int’ is not an enumeration type
/usr/include/c++/8/type_traits: In instantiation of ‘struct std::underlying_type<const char [24]>’:
/usr/include/c++/8/type_traits:2299:66:   required by substitution of ‘template<class _Tp> using underlying_type_t = typename std::underlying_type::type [with _Tp = const char [24]]’
/home/botworker/bbot/amdgpu-offload-rhel-8-cmake-build-only/llvm-project/clang/include/clang/Basic/Diagnostic.h:1441:9:   required by substitution of ‘template<class T, class U> std::enable_if_t<(is_same_v<typename std::remove_const<_Tp>::type, clang::StreamingDiagnostic> && is_scoped_enum_v<typename std::remove_reference<_UniformRandomNumberGenerator>::type>), const clang::StreamingDiagnostic&> clang::operator<<(const T&, U&&) [with T = llvm::raw_ostream; U = const char (&)[24]]’

```

</details>

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


More information about the cfe-commits mailing list