From afcf9c47c5e74a0b567531547b677ff1d383ae50 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 29 Sep 2020 17:08:42 -0700 Subject: [PATCH] Fix test failures with trunk clang - Make the consteval constructor for the zero type be noexcept - Don't expect three-way comparison of 0 against a comparison category to fail --- libcxx/include/compare | 2 +- .../cmp/cmp.categories.pre/zero_type.verify.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxx/include/compare b/libcxx/include/compare index c1cd81bb6fc1..596505f8860d 100644 --- a/libcxx/include/compare +++ b/libcxx/include/compare @@ -156,7 +156,7 @@ enum class _LIBCPP_ENUM_VIS _NCmpResult : signed char { struct _CmpUnspecifiedParam { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEVAL - _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) {} + _CmpUnspecifiedParam(int _CmpUnspecifiedParam::*) noexcept {} template>> _CmpUnspecifiedParam(_Tp) = delete; diff --git a/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp b/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp index 40f6677d43c9..fc21c03a3ddf 100644 --- a/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp +++ b/libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp @@ -46,9 +46,9 @@ void test_category(T v) { void(0 > v); void(v >= 0); void(0 >= v); -#ifndef _LIBCPP_HAS_NO_THREE_WAY_COMPARISON - void(v <=> 0); // expected-error 3 {{}} - void(0 <=> v); // expected-error 3 {{}} +#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR + void(v <=> 0); + void(0 <=> v); #endif }