[libcxx-commits] [libcxx] afcf9c4 - Fix test failures with trunk clang

Richard Smith via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 29 17:10:18 PDT 2020


Author: Richard Smith
Date: 2020-09-29T17:10:07-07:00
New Revision: afcf9c47c5e74a0b567531547b677ff1d383ae50

URL: https://github.com/llvm/llvm-project/commit/afcf9c47c5e74a0b567531547b677ff1d383ae50
DIFF: https://github.com/llvm/llvm-project/commit/afcf9c47c5e74a0b567531547b677ff1d383ae50.diff

LOG: 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

Added: 
    

Modified: 
    libcxx/include/compare
    libcxx/test/std/language.support/cmp/cmp.categories.pre/zero_type.verify.cpp

Removed: 
    


################################################################################
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<typename _Tp, typename = _VSTD::enable_if_t<!_VSTD::is_same_v<_Tp, int>>>
   _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
 }
 


        


More information about the libcxx-commits mailing list