Add test for spaceship operator to __config
authorDavid Zarzycki <dave@znu.io>
Fri, 24 Jan 2020 18:26:53 +0000 (13:26 -0500)
committerDavid Zarzycki <dave@znu.io>
Fri, 24 Jan 2020 18:27:22 +0000 (13:27 -0500)
Summary:
The libcxx test suite auto-detects spaceship operator, but __config does not. This means that the libcxx test suite has been broken for over a month when using top-of-tree clang. This also really ought to be fixed before 10.0.

See: bc633a42dd409dbeb456263e3388b8caa4680aa0

Reviewers: chandlerc, mclow.lists, EricWF, ldionne, CaseyCarter

Reviewed By: EricWF

Subscribers: broadwaylamb, hans, dexonsmith, tstellar, llvm-commits, libcxx-commits

Tags: #libc, #llvm

Differential Revision: https://reviews.llvm.org/D72980

libcxx/include/__config

index 7770009..2e45643 100644 (file)
@@ -1359,10 +1359,9 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container(
 #define _LIBCPP_HAS_NO_COROUTINES
 #endif
 
-// FIXME: Correct this macro when either (A) a feature test macro for the
-// spaceship operator is provided, or (B) a compiler provides a complete
-// implementation.
+#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201907L
 #define _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
+#endif
 
 // Decide whether to use availability macros.
 #if !defined(_LIBCPP_BUILDING_LIBRARY) &&                                      \