[llvm] [ADT] Add is_sorted_constexpr, equivalent to C++20 std::is_sorted (PR #180867)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 11 19:53:16 PST 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 60198 tests passed
* 1430 tests skipped

All executed tests passed, but another part of the build **failed**. Click on a failure below to see the details.

<details>
<summary>[code=1] unittests/ADT/CMakeFiles/ADTTests.dir/STLForwardCompatTest.cpp.obj</summary>

```
FAILED: [code=1] unittests/ADT/CMakeFiles/ADTTests.dir/STLForwardCompatTest.cpp.obj
sccache C:\clang\clang-msvc\bin\clang-cl.exe  /nologo -TP -DLLVM_BUILD_STATIC -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iunittests\ADT -IC:\_work\llvm-project\llvm-project\llvm\unittests\ADT -Iinclude -IC:\_work\llvm-project\llvm-project\llvm\include -IC:\_work\llvm-project\llvm-project\third-party\unittest\googletest\include -IC:\_work\llvm-project\llvm-project\third-party\unittest\googlemock\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /Brepro /bigobj /permissive- -Werror=unguarded-availability-new /W4  -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported /Gw /O2 /Ob2  -MD -UNDEBUG -Wno-gnu-zero-variadic-macro-arguments /EHs-c- /GR- -Wno-suggest-override -std:c++17 /showIncludes /Founittests\ADT\CMakeFiles\ADTTests.dir\STLForwardCompatTest.cpp.obj /Fdunittests\ADT\CMakeFiles\ADTTests.dir\ -c -- C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(609,37): error: constexpr variable cannot have non-literal type 'const std::array<int, 0>'
609 | static constexpr std::array<int, 0> CEmpty{};
|                                     ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(609,37): error: implicit instantiation of undefined template 'std::array<int, 0>'
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(895,7): note: template is declared here
895 | class array;
|       ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(613,37): error: constexpr variable cannot have non-literal type 'const std::array<int, 1>'
613 | static constexpr std::array<int, 1> CSingle{{42}};
|                                     ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(613,37): error: implicit instantiation of undefined template 'std::array<int, 1>'
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(895,7): note: template is declared here
895 | class array;
|       ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(620,37): error: constexpr variable cannot have non-literal type 'const std::array<int, 5>'
620 | static constexpr std::array<int, 5> CSorted{{1, 2, 2, 3, 5}};
|                                     ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(620,37): error: implicit instantiation of undefined template 'std::array<int, 5>'
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(895,7): note: template is declared here
895 | class array;
|       ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(630,37): error: constexpr variable cannot have non-literal type 'const std::array<int, 5>'
630 | static constexpr std::array<int, 5> CUnsorted{{1, 3, 2, 4, 5}};
|                                     ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(630,37): error: implicit instantiation of undefined template 'std::array<int, 5>'
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(895,7): note: template is declared here
895 | class array;
|       ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(634,37): error: constexpr variable cannot have non-literal type 'const std::array<int, 5>'
634 | static constexpr std::array<int, 5> CDesc{{9, 7, 7, 3, 0}};
|                                     ^
C:\_work\llvm-project\llvm-project\llvm\unittests\ADT\STLForwardCompatTest.cpp(634,37): error: implicit instantiation of undefined template 'std::array<int, 5>'
C:\BuildTools\VC\Tools\MSVC\14.29.30133\include\tuple(895,7): note: template is declared here
895 | class array;
|       ^
10 errors generated.
```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the llvm-commits mailing list