[llvm] [CodeGen] Get rid of incorrect `std` template specializations (PR #160804)

Paul Osmialowski via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 04:50:18 PDT 2025


pawosm-arm wrote:

Sadly, it fails in our CI:

```
[2025-09-29T11:25:35.281Z] In file included from /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:11:0:
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/include/llvm/CodeGen/ScheduleDAG.h:321:40: warning: 'llvm::SUnit::SchedulingPref' is too small to hold all values of 'enum llvm::Sched::Preference'
[2025-09-29T11:25:35.281Z]      Sched::Preference SchedulingPref : 4; ///< Scheduling preference.
[2025-09-29T11:25:35.281Z]                                         ^
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:57:1: error: non-constant condition for static assertion
[2025-09-29T11:25:35.281Z]  static_assert(CheckStdCmpRequirements<std::less<rdf::RegisterRef>>(),
[2025-09-29T11:25:35.281Z]  ^~~~~~~~~~~~~
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:57:67: error: 'constexpr bool CheckStdCmpRequirements() [with Fn = std::less<llvm::rdf::RegisterRef>]' called in a constant expression
[2025-09-29T11:25:35.281Z]  static_assert(CheckStdCmpRequirements<std::less<rdf::RegisterRef>>(),
[2025-09-29T11:25:35.281Z]                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:39:36: note: 'constexpr bool CheckStdCmpRequirements() [with Fn = std::less<llvm::rdf::RegisterRef>]' is not usable as a constexpr function because:
[2025-09-29T11:25:35.281Z]  template <class Fn> constexpr bool CheckStdCmpRequirements() {
[2025-09-29T11:25:35.281Z]                                     ^~~~~~~~~~~~~~~~~~~~~~~
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:42:6: error: uninitialized variable 'f1' in 'constexpr' function
[2025-09-29T11:25:35.281Z]    Fn f1;
[2025-09-29T11:25:35.281Z]       ^~
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:59:1: error: non-constant condition for static assertion
[2025-09-29T11:25:35.281Z]  static_assert(CheckStdCmpRequirements<std::equal_to<rdf::RegisterRef>>(),
[2025-09-29T11:25:35.281Z]  ^~~~~~~~~~~~~
[2025-09-29T11:25:35.281Z] /workspace/src/llvm/unittests/CodeGen/TypeTraitsTest.cpp:59:71: error: 'constexpr bool CheckStdCmpRequirements() [with Fn = std::equal_to<llvm::rdf::RegisterRef>]' called in a constant expression
```


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


More information about the llvm-commits mailing list