[libcxx-commits] [libcxx] 24dd2d2 - [libcxx] rearranges all concept tests
Christopher Di Bella via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Mar 27 15:14:16 PDT 2021
Author: Christopher Di Bella
Date: 2021-03-27T22:13:58Z
New Revision: 24dd2d2f9e277ef9f4c49b041b46e4cc05016922
URL: https://github.com/llvm/llvm-project/commit/24dd2d2f9e277ef9f4c49b041b46e4cc05016922
DIFF: https://github.com/llvm/llvm-project/commit/24dd2d2f9e277ef9f4c49b041b46e4cc05016922.diff
LOG: [libcxx] rearranges all concept tests
moves tests into directories matching their stable names so that the
tests can reflect the concept name
Differential Revision: https://reviews.llvm.org/D99104
Added:
libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
libcxx/test/std/concepts/concepts.callable/functions.h
libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
libcxx/test/std/concepts/concepts.compare/types.h
libcxx/test/std/concepts/concepts.lang/concept.assignable/assignable_from.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
libcxx/test/std/concepts/concepts.lang/concept.derived/derived_from.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.same/same_as.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp
libcxx/test/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp
libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/arithmetic.h
libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/floating_point.pass.cpp
libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/integral.pass.cpp
libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/signed_integral.pass.cpp
libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/unsigned_integral.pass.cpp
libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
Modified:
Removed:
libcxx/test/std/concepts/callable/functions.h
libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp
libcxx/test/std/concepts/comparison/concepts.equalitycomparable/equality_comparable.compile.pass.cpp
libcxx/test/std/concepts/comparison/concepts.equalitycomparable/equality_comparable_with.compile.pass.cpp
libcxx/test/std/concepts/comparison/types.h
libcxx/test/std/concepts/concept.constructible/constructible_from.compile.pass.cpp
libcxx/test/std/concepts/concept.default.init/default_initializable.compile.pass.cpp
libcxx/test/std/concepts/concept.default.init/default_initializable.verify.cpp
libcxx/test/std/concepts/concept.destructible/destructible.compile.pass.cpp
libcxx/test/std/concepts/lang/arithmetic.pass.cpp
libcxx/test/std/concepts/lang/assignable.compile.pass.cpp
libcxx/test/std/concepts/lang/common.compile.pass.cpp
libcxx/test/std/concepts/lang/commonreference.compile.pass.cpp
libcxx/test/std/concepts/lang/convertible.compile.pass.cpp
libcxx/test/std/concepts/lang/copyconstructible.compile.pass.cpp
libcxx/test/std/concepts/lang/derived.compile.pass.cpp
libcxx/test/std/concepts/lang/moveconstructible.compile.pass.cpp
libcxx/test/std/concepts/lang/same_as.pass.cpp
libcxx/test/std/concepts/lang/swappable.pass.cpp
libcxx/test/std/concepts/lang/swappable_with.compile.pass.cpp
libcxx/test/std/concepts/object/copyable.compile.pass.cpp
libcxx/test/std/concepts/object/movable.compile.pass.cpp
libcxx/test/std/concepts/object/regular.compile.pass.cpp
libcxx/test/std/concepts/object/semiregular.compile.pass.cpp
################################################################################
diff --git a/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
index 7bda033f85bd..f201910d5031 100644
--- a/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.callable/concept.invocable/invocable.compile.pass.cpp
@@ -18,7 +18,7 @@
#include <random>
#include <type_traits>
-#include "functions.h"
+#include "../functions.h"
// clang-format off
template <class F, class... Args>
diff --git a/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
similarity index 99%
rename from libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
index 4e0da4376176..3912504d5066 100644
--- a/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.callable/concept.regularinvocable/regular_invocable.pass.cpp
@@ -17,7 +17,7 @@
#include <random>
#include <type_traits>
-#include "functions.h"
+#include "../functions.h"
// clang-format off
template <class F, class... Args>
diff --git a/libcxx/test/std/concepts/callable/functions.h b/libcxx/test/std/concepts/concepts.callable/functions.h
similarity index 100%
rename from libcxx/test/std/concepts/callable/functions.h
rename to libcxx/test/std/concepts/concepts.callable/functions.h
diff --git a/libcxx/test/std/concepts/comparison/concepts.equalitycomparable/equality_comparable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/comparison/concepts.equalitycomparable/equality_comparable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/comparison/concepts.equalitycomparable/equality_comparable_with.compile.pass.cpp b/libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/comparison/concepts.equalitycomparable/equality_comparable_with.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/comparison/types.h b/libcxx/test/std/concepts/concepts.compare/types.h
similarity index 100%
rename from libcxx/test/std/concepts/comparison/types.h
rename to libcxx/test/std/concepts/concepts.compare/types.h
diff --git a/libcxx/test/std/concepts/lang/assignable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.assignable/assignable_from.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/assignable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.assignable/assignable_from.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/common.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/common.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.common/common_with.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/commonreference.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/commonreference.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.commonref/common_reference.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/concept.constructible/constructible_from.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
similarity index 99%
rename from libcxx/test/std/concepts/concept.constructible/constructible_from.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
index 2e59b42c3da1..4db2f9299192 100644
--- a/libcxx/test/std/concepts/concept.constructible/constructible_from.compile.pass.cpp
+++ b/libcxx/test/std/concepts/concepts.lang/concept.constructible/constructible_from.compile.pass.cpp
@@ -149,3 +149,5 @@ void test() {
test<std::array<int, 1>, int>();
test<std::array<int, 1>, int, int>();
}
+
+int main(int, char**) { return 0; }
diff --git a/libcxx/test/std/concepts/lang/convertible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/convertible.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.convertible/convertible_to.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/copyconstructible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/copyconstructible.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.copyconstructible/copy_constructible.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/concept.default.init/default_initializable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/concept.default.init/default_initializable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/concept.default.init/default_initializable.verify.cpp b/libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
similarity index 100%
rename from libcxx/test/std/concepts/concept.default.init/default_initializable.verify.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.default.init/default_initializable.verify.cpp
diff --git a/libcxx/test/std/concepts/lang/derived.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.derived/derived_from.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/derived.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.derived/derived_from.pass.cpp
diff --git a/libcxx/test/std/concepts/concept.destructible/destructible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/concept.destructible/destructible.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.destructible/destructible.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/moveconstructible.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/moveconstructible.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.moveconstructible/move_constructible.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/same_as.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.same/same_as.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/same_as.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.same/same_as.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/swappable.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/swappable.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.swappable/swappable.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/swappable_with.compile.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/lang/swappable_with.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.lang/concept.swappable/swappable_with.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/arithmetic.h b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/arithmetic.h
new file mode 100644
index 000000000000..bb7016508cca
--- /dev/null
+++ b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/arithmetic.h
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+#ifndef LIBCXX_TEST_CONCEPTS_LANG_CONCEPTS_ARITHMETIC_H_
+#define LIBCXX_TEST_CONCEPTS_LANG_CONCEPTS_ARITHMETIC_H_
+
+#include <concepts>
+
+// This overload should never be called. It exists solely to force subsumption.
+template <std::integral I>
+[[nodiscard]] constexpr bool CheckSubsumption(I) {
+ return false;
+}
+
+// clang-format off
+template <std::integral I>
+requires std::signed_integral<I> && (!std::unsigned_integral<I>)
+[[nodiscard]] constexpr bool CheckSubsumption(I) {
+ return std::is_signed_v<I>;
+}
+
+template <std::integral I>
+requires std::unsigned_integral<I> && (!std::signed_integral<I>)
+[[nodiscard]] constexpr bool CheckSubsumption(I) {
+ return std::is_unsigned_v<I>;
+}
+// clang-format on
+
+enum ClassicEnum { a, b, c };
+enum class ScopedEnum { x, y, z };
+struct EmptyStruct {};
+
+#endif // LIBCXX_TEST_CONCEPTS_LANG_CONCEPTS_ARITHMETIC_H_
diff --git a/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/floating_point.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/floating_point.pass.cpp
new file mode 100644
index 000000000000..b540ceb4a06b
--- /dev/null
+++ b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/floating_point.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+
+// template<class T>
+// concept floating_point = // see below
+
+#include <concepts>
+#include <type_traits>
+
+#include "arithmetic.h"
+
+template <typename T>
+constexpr bool CheckFloatingPointQualifiers() {
+ constexpr bool result = std::floating_point<T>;
+ static_assert(std::floating_point<const T> == result);
+ static_assert(std::floating_point<volatile T> == result);
+ static_assert(std::floating_point<const volatile T> == result);
+
+ static_assert(!std::floating_point<T&>);
+ static_assert(!std::floating_point<const T&>);
+ static_assert(!std::floating_point<volatile T&>);
+ static_assert(!std::floating_point<const volatile T&>);
+
+ static_assert(!std::floating_point<T&&>);
+ static_assert(!std::floating_point<const T&&>);
+ static_assert(!std::floating_point<volatile T&&>);
+ static_assert(!std::floating_point<const volatile T&&>);
+
+ static_assert(!std::floating_point<T*>);
+ static_assert(!std::floating_point<const T*>);
+ static_assert(!std::floating_point<volatile T*>);
+ static_assert(!std::floating_point<const volatile T*>);
+
+ static_assert(!std::floating_point<T (*)()>);
+ static_assert(!std::floating_point<T (&)()>);
+ static_assert(!std::floating_point<T(&&)()>);
+
+ return result;
+}
+
+// floating-point types
+static_assert(CheckFloatingPointQualifiers<float>());
+static_assert(CheckFloatingPointQualifiers<double>());
+static_assert(CheckFloatingPointQualifiers<long double>());
+
+// types that aren't floating-point
+static_assert(!CheckFloatingPointQualifiers<signed char>());
+static_assert(!CheckFloatingPointQualifiers<unsigned char>());
+static_assert(!CheckFloatingPointQualifiers<short>());
+static_assert(!CheckFloatingPointQualifiers<unsigned short>());
+static_assert(!CheckFloatingPointQualifiers<int>());
+static_assert(!CheckFloatingPointQualifiers<unsigned int>());
+static_assert(!CheckFloatingPointQualifiers<long>());
+static_assert(!CheckFloatingPointQualifiers<unsigned long>());
+static_assert(!CheckFloatingPointQualifiers<long long>());
+static_assert(!CheckFloatingPointQualifiers<unsigned long long>());
+static_assert(!CheckFloatingPointQualifiers<wchar_t>());
+static_assert(!CheckFloatingPointQualifiers<bool>());
+static_assert(!CheckFloatingPointQualifiers<char>());
+static_assert(!CheckFloatingPointQualifiers<char8_t>());
+static_assert(!CheckFloatingPointQualifiers<char16_t>());
+static_assert(!CheckFloatingPointQualifiers<char32_t>());
+static_assert(!std::floating_point<void>);
+
+static_assert(!CheckFloatingPointQualifiers<ClassicEnum>());
+static_assert(!CheckFloatingPointQualifiers<ScopedEnum>());
+static_assert(!CheckFloatingPointQualifiers<EmptyStruct>());
+static_assert(!CheckFloatingPointQualifiers<int EmptyStruct::*>());
+static_assert(!CheckFloatingPointQualifiers<int (EmptyStruct::*)()>());
+
+int main(int, char**) { return 0; }
diff --git a/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/integral.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/integral.pass.cpp
new file mode 100644
index 000000000000..42b85a1c020b
--- /dev/null
+++ b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/integral.pass.cpp
@@ -0,0 +1,92 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+
+// template<class T>
+// concept integral = // see below
+
+#include <concepts>
+#include <type_traits>
+
+#include "arithmetic.h"
+
+template <typename T>
+constexpr bool CheckIntegralQualifiers() {
+ constexpr bool result = std::integral<T>;
+ static_assert(std::integral<const T> == result);
+ static_assert(std::integral<volatile T> == result);
+ static_assert(std::integral<const volatile T> == result);
+
+ static_assert(!std::integral<T&>);
+ static_assert(!std::integral<const T&>);
+ static_assert(!std::integral<volatile T&>);
+ static_assert(!std::integral<const volatile T&>);
+
+ static_assert(!std::integral<T&&>);
+ static_assert(!std::integral<const T&&>);
+ static_assert(!std::integral<volatile T&&>);
+ static_assert(!std::integral<const volatile T&&>);
+
+ static_assert(!std::integral<T*>);
+ static_assert(!std::integral<const T*>);
+ static_assert(!std::integral<volatile T*>);
+ static_assert(!std::integral<const volatile T*>);
+
+ static_assert(!std::integral<T (*)()>);
+ static_assert(!std::integral<T (&)()>);
+ static_assert(!std::integral<T(&&)()>);
+
+ return result;
+}
+
+// standard signed and unsigned integers
+static_assert(CheckIntegralQualifiers<signed char>());
+static_assert(CheckIntegralQualifiers<unsigned char>());
+static_assert(CheckIntegralQualifiers<short>());
+static_assert(CheckIntegralQualifiers<unsigned short>());
+static_assert(CheckIntegralQualifiers<int>());
+static_assert(CheckIntegralQualifiers<unsigned int>());
+static_assert(CheckIntegralQualifiers<long>());
+static_assert(CheckIntegralQualifiers<unsigned long>());
+static_assert(CheckIntegralQualifiers<long long>());
+static_assert(CheckIntegralQualifiers<unsigned long long>());
+
+// extended integers
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(CheckIntegralQualifiers<__int128_t>());
+static_assert(CheckIntegralQualifiers<__uint128_t>());
+#endif
+
+// bool and char types are also integral
+static_assert(CheckIntegralQualifiers<wchar_t>());
+static_assert(CheckIntegralQualifiers<bool>());
+static_assert(CheckIntegralQualifiers<char>());
+static_assert(CheckIntegralQualifiers<char8_t>());
+static_assert(CheckIntegralQualifiers<char16_t>());
+static_assert(CheckIntegralQualifiers<char32_t>());
+
+// types that aren't integral
+static_assert(!std::integral<void>);
+static_assert(!CheckIntegralQualifiers<float>());
+static_assert(!CheckIntegralQualifiers<double>());
+static_assert(!CheckIntegralQualifiers<long double>());
+
+static_assert(!CheckIntegralQualifiers<ClassicEnum>());
+
+static_assert(!CheckIntegralQualifiers<ScopedEnum>());
+
+static_assert(!CheckIntegralQualifiers<EmptyStruct>());
+static_assert(!CheckIntegralQualifiers<int EmptyStruct::*>());
+static_assert(!CheckIntegralQualifiers<int (EmptyStruct::*)()>());
+
+static_assert(CheckSubsumption(0));
+static_assert(CheckSubsumption(0U));
+
+int main(int, char**) { return 0; }
diff --git a/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/signed_integral.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/signed_integral.pass.cpp
new file mode 100644
index 000000000000..df97b39709dc
--- /dev/null
+++ b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/signed_integral.pass.cpp
@@ -0,0 +1,96 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+
+// template<class T>
+// concept signed_integral = // see below
+
+#include <concepts>
+#include <type_traits>
+
+#include "arithmetic.h"
+
+template <typename T>
+constexpr bool CheckSignedIntegralQualifiers() {
+ constexpr bool result = std::signed_integral<T>;
+ static_assert(std::signed_integral<const T> == result);
+ static_assert(std::signed_integral<volatile T> == result);
+ static_assert(std::signed_integral<const volatile T> == result);
+
+ static_assert(!std::signed_integral<T&>);
+ static_assert(!std::signed_integral<const T&>);
+ static_assert(!std::signed_integral<volatile T&>);
+ static_assert(!std::signed_integral<const volatile T&>);
+
+ static_assert(!std::signed_integral<T&&>);
+ static_assert(!std::signed_integral<const T&&>);
+ static_assert(!std::signed_integral<volatile T&&>);
+ static_assert(!std::signed_integral<const volatile T&&>);
+
+ static_assert(!std::signed_integral<T*>);
+ static_assert(!std::signed_integral<const T*>);
+ static_assert(!std::signed_integral<volatile T*>);
+ static_assert(!std::signed_integral<const volatile T*>);
+
+ static_assert(!std::signed_integral<T (*)()>);
+ static_assert(!std::signed_integral<T (&)()>);
+ static_assert(!std::signed_integral<T(&&)()>);
+
+ return result;
+}
+
+// standard signed integers
+static_assert(CheckSignedIntegralQualifiers<signed char>());
+static_assert(CheckSignedIntegralQualifiers<short>());
+static_assert(CheckSignedIntegralQualifiers<int>());
+static_assert(CheckSignedIntegralQualifiers<long>());
+static_assert(CheckSignedIntegralQualifiers<long long>());
+
+// bool and character *may* be signed
+static_assert(CheckSignedIntegralQualifiers<wchar_t>() ==
+ std::is_signed_v<wchar_t>);
+static_assert(CheckSignedIntegralQualifiers<bool>() == std::is_signed_v<bool>);
+static_assert(CheckSignedIntegralQualifiers<char>() == std::is_signed_v<char>);
+static_assert(CheckSignedIntegralQualifiers<char8_t>() ==
+ std::is_signed_v<char8_t>);
+static_assert(CheckSignedIntegralQualifiers<char16_t>() ==
+ std::is_signed_v<char16_t>);
+static_assert(CheckSignedIntegralQualifiers<char32_t>() ==
+ std::is_signed_v<char32_t>);
+
+// integers that aren't signed integrals
+static_assert(!CheckSignedIntegralQualifiers<unsigned char>());
+static_assert(!CheckSignedIntegralQualifiers<unsigned short>());
+static_assert(!CheckSignedIntegralQualifiers<unsigned int>());
+static_assert(!CheckSignedIntegralQualifiers<unsigned long>());
+static_assert(!CheckSignedIntegralQualifiers<unsigned long long>());
+
+// extended integers
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(CheckSignedIntegralQualifiers<__int128_t>());
+static_assert(!CheckSignedIntegralQualifiers<__uint128_t>());
+#endif
+
+// types that aren't even integers shouldn't be signed integers!
+static_assert(!std::signed_integral<void>);
+static_assert(!CheckSignedIntegralQualifiers<float>());
+static_assert(!CheckSignedIntegralQualifiers<double>());
+static_assert(!CheckSignedIntegralQualifiers<long double>());
+
+static_assert(!CheckSignedIntegralQualifiers<ClassicEnum>());
+static_assert(!CheckSignedIntegralQualifiers<ScopedEnum>());
+static_assert(!CheckSignedIntegralQualifiers<EmptyStruct>());
+static_assert(!CheckSignedIntegralQualifiers<int EmptyStruct::*>());
+static_assert(!CheckSignedIntegralQualifiers<int (EmptyStruct::*)()>());
+
+static_assert(CheckSubsumption(0));
+static_assert(CheckSubsumption(0U));
+
+int main(int, char**) { return 0; }
diff --git a/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/unsigned_integral.pass.cpp b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/unsigned_integral.pass.cpp
new file mode 100644
index 000000000000..02a62865f2dd
--- /dev/null
+++ b/libcxx/test/std/concepts/concepts.lang/concepts.arithmetic/unsigned_integral.pass.cpp
@@ -0,0 +1,97 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17
+// UNSUPPORTED: libcpp-no-concepts
+
+// template<class T>
+// concept unsigned_integral = // see below
+
+#include <concepts>
+#include <type_traits>
+
+#include "arithmetic.h"
+
+template <typename T>
+constexpr bool CheckUnsignedIntegralQualifiers() {
+ constexpr bool result = std::unsigned_integral<T>;
+ static_assert(std::unsigned_integral<const T> == result);
+ static_assert(std::unsigned_integral<volatile T> == result);
+ static_assert(std::unsigned_integral<const volatile T> == result);
+
+ static_assert(!std::unsigned_integral<T&>);
+ static_assert(!std::unsigned_integral<const T&>);
+ static_assert(!std::unsigned_integral<volatile T&>);
+ static_assert(!std::unsigned_integral<const volatile T&>);
+
+ static_assert(!std::unsigned_integral<T&&>);
+ static_assert(!std::unsigned_integral<const T&&>);
+ static_assert(!std::unsigned_integral<volatile T&&>);
+ static_assert(!std::unsigned_integral<const volatile T&&>);
+
+ static_assert(!std::unsigned_integral<T*>);
+ static_assert(!std::unsigned_integral<const T*>);
+ static_assert(!std::unsigned_integral<volatile T*>);
+ static_assert(!std::unsigned_integral<const volatile T*>);
+
+ static_assert(!std::unsigned_integral<T (*)()>);
+ static_assert(!std::unsigned_integral<T (&)()>);
+ static_assert(!std::unsigned_integral<T(&&)()>);
+
+ return result;
+}
+
+// standard unsigned types
+static_assert(CheckUnsignedIntegralQualifiers<unsigned char>());
+static_assert(CheckUnsignedIntegralQualifiers<unsigned short>());
+static_assert(CheckUnsignedIntegralQualifiers<unsigned int>());
+static_assert(CheckUnsignedIntegralQualifiers<unsigned long>());
+static_assert(CheckUnsignedIntegralQualifiers<unsigned long long>());
+
+// Whether bool and character types are signed or unsigned is impl-defined
+static_assert(CheckUnsignedIntegralQualifiers<wchar_t>() ==
+ !std::is_signed_v<wchar_t>);
+static_assert(CheckUnsignedIntegralQualifiers<bool>() ==
+ !std::is_signed_v<bool>);
+static_assert(CheckUnsignedIntegralQualifiers<char>() ==
+ !std::is_signed_v<char>);
+static_assert(CheckUnsignedIntegralQualifiers<char8_t>() ==
+ !std::is_signed_v<char8_t>);
+static_assert(CheckUnsignedIntegralQualifiers<char16_t>() ==
+ !std::is_signed_v<char16_t>);
+static_assert(CheckUnsignedIntegralQualifiers<char32_t>() ==
+ !std::is_signed_v<char32_t>);
+
+// extended integers
+#ifndef _LIBCPP_HAS_NO_INT128
+static_assert(CheckUnsignedIntegralQualifiers<__uint128_t>());
+static_assert(!CheckUnsignedIntegralQualifiers<__int128_t>());
+#endif
+
+// integer types that aren't unsigned integrals
+static_assert(!CheckUnsignedIntegralQualifiers<signed char>());
+static_assert(!CheckUnsignedIntegralQualifiers<short>());
+static_assert(!CheckUnsignedIntegralQualifiers<int>());
+static_assert(!CheckUnsignedIntegralQualifiers<long>());
+static_assert(!CheckUnsignedIntegralQualifiers<long long>());
+
+static_assert(!std::unsigned_integral<void>);
+static_assert(!CheckUnsignedIntegralQualifiers<float>());
+static_assert(!CheckUnsignedIntegralQualifiers<double>());
+static_assert(!CheckUnsignedIntegralQualifiers<long double>());
+
+static_assert(!CheckUnsignedIntegralQualifiers<ClassicEnum>());
+static_assert(!CheckUnsignedIntegralQualifiers<ScopedEnum>());
+static_assert(!CheckUnsignedIntegralQualifiers<EmptyStruct>());
+static_assert(!CheckUnsignedIntegralQualifiers<int EmptyStruct::*>());
+static_assert(!CheckUnsignedIntegralQualifiers<int (EmptyStruct::*)()>());
+
+static_assert(CheckSubsumption(0));
+static_assert(CheckSubsumption(0U));
+
+int main(int, char**) { return 0; }
diff --git a/libcxx/test/std/concepts/object/copyable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/object/copyable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.object/copyable.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/object/movable.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/object/movable.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.object/movable.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/object/regular.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/object/regular.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.object/regular.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/object/semiregular.compile.pass.cpp b/libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
similarity index 100%
rename from libcxx/test/std/concepts/object/semiregular.compile.pass.cpp
rename to libcxx/test/std/concepts/concepts.object/semiregular.compile.pass.cpp
diff --git a/libcxx/test/std/concepts/lang/arithmetic.pass.cpp b/libcxx/test/std/concepts/lang/arithmetic.pass.cpp
deleted file mode 100644
index 9b7b75b27cc1..000000000000
--- a/libcxx/test/std/concepts/lang/arithmetic.pass.cpp
+++ /dev/null
@@ -1,346 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-// UNSUPPORTED: libcpp-no-concepts
-
-// template<class T>
-// concept integral = // see below
-
-// template<class T>
-// concept signed_integral = // see below
-
-// template<class T>
-// concept unsigned_integral = // see below
-
-// template<class T>
-// concept floating_point = // see below
-
-#include <concepts>
-#include <type_traits>
-
-namespace {
-template <typename T>
-constexpr bool CheckIntegralQualifiers() {
- constexpr bool result = std::integral<T>;
- static_assert(std::integral<const T> == result);
- static_assert(std::integral<volatile T> == result);
- static_assert(std::integral<const volatile T> == result);
-
- static_assert(!std::integral<T&>);
- static_assert(!std::integral<const T&>);
- static_assert(!std::integral<volatile T&>);
- static_assert(!std::integral<const volatile T&>);
-
- static_assert(!std::integral<T&&>);
- static_assert(!std::integral<const T&&>);
- static_assert(!std::integral<volatile T&&>);
- static_assert(!std::integral<const volatile T&&>);
-
- static_assert(!std::integral<T*>);
- static_assert(!std::integral<const T*>);
- static_assert(!std::integral<volatile T*>);
- static_assert(!std::integral<const volatile T*>);
-
- static_assert(!std::integral<T (*)()>);
- static_assert(!std::integral<T (&)()>);
- static_assert(!std::integral<T(&&)()>);
-
- return result;
-}
-
-enum ClassicEnum { a, b, c };
-enum class ScopedEnum { x, y, z };
-struct EmptyStruct {};
-
-constexpr void CheckIntegral() {
- // standard signed and unsigned integers
- static_assert(CheckIntegralQualifiers<signed char>());
- static_assert(CheckIntegralQualifiers<unsigned char>());
- static_assert(CheckIntegralQualifiers<short>());
- static_assert(CheckIntegralQualifiers<unsigned short>());
- static_assert(CheckIntegralQualifiers<int>());
- static_assert(CheckIntegralQualifiers<unsigned int>());
- static_assert(CheckIntegralQualifiers<long>());
- static_assert(CheckIntegralQualifiers<unsigned long>());
- static_assert(CheckIntegralQualifiers<long long>());
- static_assert(CheckIntegralQualifiers<unsigned long long>());
-
- // extended integers
-#ifndef _LIBCPP_HAS_NO_INT128
- static_assert(CheckIntegralQualifiers<__int128_t>());
- static_assert(CheckIntegralQualifiers<__uint128_t>());
-#endif
-
- // bool and char types are also integral
- static_assert(CheckIntegralQualifiers<wchar_t>());
- static_assert(CheckIntegralQualifiers<bool>());
- static_assert(CheckIntegralQualifiers<char>());
- static_assert(CheckIntegralQualifiers<char8_t>());
- static_assert(CheckIntegralQualifiers<char16_t>());
- static_assert(CheckIntegralQualifiers<char32_t>());
-
- // types that aren't integral
- static_assert(!std::integral<void>);
- static_assert(!CheckIntegralQualifiers<float>());
- static_assert(!CheckIntegralQualifiers<double>());
- static_assert(!CheckIntegralQualifiers<long double>());
-
- static_assert(!CheckIntegralQualifiers<ClassicEnum>());
-
- static_assert(!CheckIntegralQualifiers<ScopedEnum>());
-
- static_assert(!CheckIntegralQualifiers<EmptyStruct>());
- static_assert(!CheckIntegralQualifiers<int EmptyStruct::*>());
- static_assert(!CheckIntegralQualifiers<int (EmptyStruct::*)()>());
-}
-
-template <typename T>
-constexpr bool CheckSignedIntegralQualifiers() {
- constexpr bool result = std::signed_integral<T>;
- static_assert(std::signed_integral<const T> == result);
- static_assert(std::signed_integral<volatile T> == result);
- static_assert(std::signed_integral<const volatile T> == result);
-
- static_assert(!std::signed_integral<T&>);
- static_assert(!std::signed_integral<const T&>);
- static_assert(!std::signed_integral<volatile T&>);
- static_assert(!std::signed_integral<const volatile T&>);
-
- static_assert(!std::signed_integral<T&&>);
- static_assert(!std::signed_integral<const T&&>);
- static_assert(!std::signed_integral<volatile T&&>);
- static_assert(!std::signed_integral<const volatile T&&>);
-
- static_assert(!std::signed_integral<T*>);
- static_assert(!std::signed_integral<const T*>);
- static_assert(!std::signed_integral<volatile T*>);
- static_assert(!std::signed_integral<const volatile T*>);
-
- static_assert(!std::signed_integral<T (*)()>);
- static_assert(!std::signed_integral<T (&)()>);
- static_assert(!std::signed_integral<T(&&)()>);
-
- return result;
-}
-
-constexpr void CheckSignedIntegral() {
- // standard signed integers
- static_assert(CheckSignedIntegralQualifiers<signed char>());
- static_assert(CheckSignedIntegralQualifiers<short>());
- static_assert(CheckSignedIntegralQualifiers<int>());
- static_assert(CheckSignedIntegralQualifiers<long>());
- static_assert(CheckSignedIntegralQualifiers<long long>());
-
- // bool and character *may* be signed
- static_assert(CheckSignedIntegralQualifiers<wchar_t>() ==
- std::is_signed_v<wchar_t>);
- static_assert(CheckSignedIntegralQualifiers<bool>() ==
- std::is_signed_v<bool>);
- static_assert(CheckSignedIntegralQualifiers<char>() ==
- std::is_signed_v<char>);
- static_assert(CheckSignedIntegralQualifiers<char8_t>() ==
- std::is_signed_v<char8_t>);
- static_assert(CheckSignedIntegralQualifiers<char16_t>() ==
- std::is_signed_v<char16_t>);
- static_assert(CheckSignedIntegralQualifiers<char32_t>() ==
- std::is_signed_v<char32_t>);
-
- // integers that aren't signed integrals
- static_assert(!CheckSignedIntegralQualifiers<unsigned char>());
- static_assert(!CheckSignedIntegralQualifiers<unsigned short>());
- static_assert(!CheckSignedIntegralQualifiers<unsigned int>());
- static_assert(!CheckSignedIntegralQualifiers<unsigned long>());
- static_assert(!CheckSignedIntegralQualifiers<unsigned long long>());
-
- // extended integers
-#ifndef _LIBCPP_HAS_NO_INT128
- static_assert(CheckSignedIntegralQualifiers<__int128_t>());
- static_assert(!CheckSignedIntegralQualifiers<__uint128_t>());
-#endif
-
- // types that aren't even integers shouldn't be signed integers!
- static_assert(!std::signed_integral<void>);
- static_assert(!CheckSignedIntegralQualifiers<float>());
- static_assert(!CheckSignedIntegralQualifiers<double>());
- static_assert(!CheckSignedIntegralQualifiers<long double>());
-
- static_assert(!CheckSignedIntegralQualifiers<ClassicEnum>());
- static_assert(!CheckSignedIntegralQualifiers<ScopedEnum>());
- static_assert(!CheckSignedIntegralQualifiers<EmptyStruct>());
- static_assert(!CheckSignedIntegralQualifiers<int EmptyStruct::*>());
- static_assert(!CheckSignedIntegralQualifiers<int (EmptyStruct::*)()>());
-}
-
-template <typename T>
-constexpr bool CheckUnsignedIntegralQualifiers() {
- constexpr bool result = std::unsigned_integral<T>;
- static_assert(std::unsigned_integral<const T> == result);
- static_assert(std::unsigned_integral<volatile T> == result);
- static_assert(std::unsigned_integral<const volatile T> == result);
-
- static_assert(!std::unsigned_integral<T&>);
- static_assert(!std::unsigned_integral<const T&>);
- static_assert(!std::unsigned_integral<volatile T&>);
- static_assert(!std::unsigned_integral<const volatile T&>);
-
- static_assert(!std::unsigned_integral<T&&>);
- static_assert(!std::unsigned_integral<const T&&>);
- static_assert(!std::unsigned_integral<volatile T&&>);
- static_assert(!std::unsigned_integral<const volatile T&&>);
-
- static_assert(!std::unsigned_integral<T*>);
- static_assert(!std::unsigned_integral<const T*>);
- static_assert(!std::unsigned_integral<volatile T*>);
- static_assert(!std::unsigned_integral<const volatile T*>);
-
- static_assert(!std::unsigned_integral<T (*)()>);
- static_assert(!std::unsigned_integral<T (&)()>);
- static_assert(!std::unsigned_integral<T(&&)()>);
-
- return result;
-}
-
-constexpr void CheckUnsignedIntegral() {
- // standard unsigned types
- static_assert(CheckUnsignedIntegralQualifiers<unsigned char>());
- static_assert(CheckUnsignedIntegralQualifiers<unsigned short>());
- static_assert(CheckUnsignedIntegralQualifiers<unsigned int>());
- static_assert(CheckUnsignedIntegralQualifiers<unsigned long>());
- static_assert(CheckUnsignedIntegralQualifiers<unsigned long long>());
-
- // Whether bool and character types are signed or unsigned is impl-defined
- static_assert(CheckUnsignedIntegralQualifiers<wchar_t>() ==
- !std::is_signed_v<wchar_t>);
- static_assert(CheckUnsignedIntegralQualifiers<bool>() ==
- !std::is_signed_v<bool>);
- static_assert(CheckUnsignedIntegralQualifiers<char>() ==
- !std::is_signed_v<char>);
- static_assert(CheckUnsignedIntegralQualifiers<char8_t>() ==
- !std::is_signed_v<char8_t>);
- static_assert(CheckUnsignedIntegralQualifiers<char16_t>() ==
- !std::is_signed_v<char16_t>);
- static_assert(CheckUnsignedIntegralQualifiers<char32_t>() ==
- !std::is_signed_v<char32_t>);
-
- // extended integers
-#ifndef _LIBCPP_HAS_NO_INT128
- static_assert(CheckUnsignedIntegralQualifiers<__uint128_t>());
- static_assert(!CheckUnsignedIntegralQualifiers<__int128_t>());
-#endif
-
- // integer types that aren't unsigned integrals
- static_assert(!CheckUnsignedIntegralQualifiers<signed char>());
- static_assert(!CheckUnsignedIntegralQualifiers<short>());
- static_assert(!CheckUnsignedIntegralQualifiers<int>());
- static_assert(!CheckUnsignedIntegralQualifiers<long>());
- static_assert(!CheckUnsignedIntegralQualifiers<long long>());
-
- static_assert(!std::unsigned_integral<void>);
- static_assert(!CheckUnsignedIntegralQualifiers<float>());
- static_assert(!CheckUnsignedIntegralQualifiers<double>());
- static_assert(!CheckUnsignedIntegralQualifiers<long double>());
-
- static_assert(!CheckUnsignedIntegralQualifiers<ClassicEnum>());
- static_assert(!CheckUnsignedIntegralQualifiers<ScopedEnum>());
- static_assert(!CheckUnsignedIntegralQualifiers<EmptyStruct>());
- static_assert(!CheckUnsignedIntegralQualifiers<int EmptyStruct::*>());
- static_assert(!CheckUnsignedIntegralQualifiers<int (EmptyStruct::*)()>());
-}
-
-// This overload should never be called. It exists solely to force subsumption.
-template <std::integral I>
-[[nodiscard]] constexpr bool CheckSubsumption(I) {
- return false;
-}
-
-// clang-format off
-template <std::integral I>
-requires std::signed_integral<I> && (!std::unsigned_integral<I>)
-[[nodiscard]] constexpr bool CheckSubsumption(I) {
- return std::is_signed_v<I>;
-}
-
-template <std::integral I>
-requires std::unsigned_integral<I> && (!std::signed_integral<I>)
-[[nodiscard]] constexpr bool CheckSubsumption(I) {
- return std::is_unsigned_v<I>;
-}
-// clang-format on
-
-template <typename T>
-constexpr bool CheckFloatingPointQualifiers() {
- constexpr bool result = std::floating_point<T>;
- static_assert(std::floating_point<const T> == result);
- static_assert(std::floating_point<volatile T> == result);
- static_assert(std::floating_point<const volatile T> == result);
-
- static_assert(!std::floating_point<T&>);
- static_assert(!std::floating_point<const T&>);
- static_assert(!std::floating_point<volatile T&>);
- static_assert(!std::floating_point<const volatile T&>);
-
- static_assert(!std::floating_point<T&&>);
- static_assert(!std::floating_point<const T&&>);
- static_assert(!std::floating_point<volatile T&&>);
- static_assert(!std::floating_point<const volatile T&&>);
-
- static_assert(!std::floating_point<T*>);
- static_assert(!std::floating_point<const T*>);
- static_assert(!std::floating_point<volatile T*>);
- static_assert(!std::floating_point<const volatile T*>);
-
- static_assert(!std::floating_point<T (*)()>);
- static_assert(!std::floating_point<T (&)()>);
- static_assert(!std::floating_point<T(&&)()>);
-
- return result;
-}
-
-constexpr void CheckFloatingPoint() {
- // floating-point types
- static_assert(CheckFloatingPointQualifiers<float>());
- static_assert(CheckFloatingPointQualifiers<double>());
- static_assert(CheckFloatingPointQualifiers<long double>());
-
- // types that aren't floating-point
- static_assert(!CheckFloatingPointQualifiers<signed char>());
- static_assert(!CheckFloatingPointQualifiers<unsigned char>());
- static_assert(!CheckFloatingPointQualifiers<short>());
- static_assert(!CheckFloatingPointQualifiers<unsigned short>());
- static_assert(!CheckFloatingPointQualifiers<int>());
- static_assert(!CheckFloatingPointQualifiers<unsigned int>());
- static_assert(!CheckFloatingPointQualifiers<long>());
- static_assert(!CheckFloatingPointQualifiers<unsigned long>());
- static_assert(!CheckFloatingPointQualifiers<long long>());
- static_assert(!CheckFloatingPointQualifiers<unsigned long long>());
- static_assert(!CheckFloatingPointQualifiers<wchar_t>());
- static_assert(!CheckFloatingPointQualifiers<bool>());
- static_assert(!CheckFloatingPointQualifiers<char>());
- static_assert(!CheckFloatingPointQualifiers<char8_t>());
- static_assert(!CheckFloatingPointQualifiers<char16_t>());
- static_assert(!CheckFloatingPointQualifiers<char32_t>());
- static_assert(!std::floating_point<void>);
-
- static_assert(!CheckFloatingPointQualifiers<ClassicEnum>());
- static_assert(!CheckFloatingPointQualifiers<ScopedEnum>());
- static_assert(!CheckFloatingPointQualifiers<EmptyStruct>());
- static_assert(!CheckFloatingPointQualifiers<int EmptyStruct::*>());
- static_assert(!CheckFloatingPointQualifiers<int (EmptyStruct::*)()>());
-}
-} // namespace
-
-int main(int, char**) {
- CheckIntegral();
- CheckSignedIntegral();
- CheckUnsignedIntegral();
- static_assert(CheckSubsumption(0));
- static_assert(CheckSubsumption(0U));
- CheckFloatingPoint();
- return 0;
-}
More information about the libcxx-commits
mailing list