[libcxx-commits] [PATCH] D82171: [libc++] Require concepts support for <numbers>

Raul Tambre via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 19 03:12:00 PDT 2020


tambre created this revision.
tambre added reviewers: ldionne, kamleshbhalui.
Herald added subscribers: libcxx-commits, dexonsmith.
Herald added a project: libc++.
Herald added a reviewer: libc++.
tambre added a reviewer: EricWF.
tambre added a comment.

D77505 <https://reviews.llvm.org/D77505> broke a bunch of bots. This fixes the regression.

I lack commit privileges. Please land as "Raul Tambre <raul at tambre.ee>"


Similar to <concepts> we need to protect the header and test against inclusion and being run if concepts aren't supported by the compiler.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82171

Files:
  libcxx/include/numbers
  libcxx/test/std/numerics/numbers/defined.pass.cpp
  libcxx/test/std/numerics/numbers/illformed.verify.cpp
  libcxx/test/std/numerics/numbers/specialize.pass.cpp
  libcxx/test/std/numerics/numbers/user_type.pass.cpp
  libcxx/test/std/numerics/numbers/value.pass.cpp


Index: libcxx/test/std/numerics/numbers/value.pass.cpp
===================================================================
--- libcxx/test/std/numerics/numbers/value.pass.cpp
+++ libcxx/test/std/numerics/numbers/value.pass.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
 
 #include <cassert>
 #include <numbers>
Index: libcxx/test/std/numerics/numbers/user_type.pass.cpp
===================================================================
--- libcxx/test/std/numerics/numbers/user_type.pass.cpp
+++ libcxx/test/std/numerics/numbers/user_type.pass.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
 
 #include <numbers>
 
Index: libcxx/test/std/numerics/numbers/specialize.pass.cpp
===================================================================
--- libcxx/test/std/numerics/numbers/specialize.pass.cpp
+++ libcxx/test/std/numerics/numbers/specialize.pass.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
 
 #include <cassert>
 #include <numbers>
Index: libcxx/test/std/numerics/numbers/illformed.verify.cpp
===================================================================
--- libcxx/test/std/numerics/numbers/illformed.verify.cpp
+++ libcxx/test/std/numerics/numbers/illformed.verify.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
 
 #include <numbers>
 
Index: libcxx/test/std/numerics/numbers/defined.pass.cpp
===================================================================
--- libcxx/test/std/numerics/numbers/defined.pass.cpp
+++ libcxx/test/std/numerics/numbers/defined.pass.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
 
 #include <numbers>
 
Index: libcxx/include/numbers
===================================================================
--- libcxx/include/numbers
+++ libcxx/include/numbers
@@ -60,7 +60,7 @@
 
 #include <__config>
 
-#if _LIBCPP_STD_VER > 17
+#if _LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
 
 #include <type_traits>
 #include <version>
@@ -136,6 +136,6 @@
 
 _LIBCPP_POP_MACROS
 
-#endif //_LIBCPP_STD_VER > 17
+#endif //_LIBCPP_STD_VER > 17 && defined(__cpp_concepts) && __cpp_concepts >= 201811L
 
 #endif // _LIBCPP_NUMBERS


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82171.271978.patch
Type: text/x-patch
Size: 2817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200619/4b7c6276/attachment.bin>


More information about the libcxx-commits mailing list