Index: libcxx/include/__compare/ordering.h =================================================================== --- libcxx/include/__compare/ordering.h +++ libcxx/include/__compare/ordering.h @@ -40,8 +40,12 @@ inline constexpr bool __one_of_v = (is_same_v<_Tp, _Args> || ...); struct _CmpUnspecifiedParam { - _LIBCPP_HIDE_FROM_ABI constexpr - _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {} + _LIBCPP_HIDE_FROM_ABI consteval + _CmpUnspecifiedParam(int __literal_zero) noexcept { + if (__literal_zero != 0) { + __builtin_abort(); + } + } template>> _CmpUnspecifiedParam(_Tp) = delete; Index: libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp =================================================================== --- libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp +++ libcxx/test/std/language.support/cmp/cmp.partialord/partialord.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// ADDITIONAL_COMPILE_FLAGS: -Wzero-as-null-pointer-constant // Index: libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp =================================================================== --- libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp +++ libcxx/test/std/language.support/cmp/cmp.strongord/strongord.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// ADDITIONAL_COMPILE_FLAGS: -Wzero-as-null-pointer-constant // Index: libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp =================================================================== --- libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp +++ libcxx/test/std/language.support/cmp/cmp.weakord/weakord.pass.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03, c++11, c++14, c++17 +// ADDITIONAL_COMPILE_FLAGS: -Wzero-as-null-pointer-constant //