//===----------------------------------------------------------------------===// // // 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 // SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. // //===----------------------------------------------------------------------===// // template // concept regular = see below; #include #include #include "test_macros.h" #include "type_classification/moveconstructible.h" #include "type_classification/semiregular.h" using cuda::std::regular; static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); struct S {}; static_assert(!regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() & noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() && noexcept >, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() const& noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() const&& noexcept >, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() volatile & noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() volatile && noexcept >, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() const volatile& noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(S::*)() const volatile&& noexcept >, ""); union U {}; static_assert(!regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() & noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() && noexcept >, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() const& noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() const&& noexcept >, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() volatile & noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() volatile && noexcept >, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() const volatile& noexcept >, ""); static_assert(regular, ""); static_assert(regular < int(U::*)() const volatile&& noexcept >, ""); static_assert(!regular, ""); static_assert(!regular, ""); // Not objects static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); // not copyable static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); #if !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 // MSVC chokes on multiple definitions // of SMF static_assert(!regular, ""); #endif // !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); // not default_initializable static_assert(!regular, ""); static_assert(!regular, ""); #if !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 // MSVC chokes on multiple definitions // of SMF static_assert(cuda::std::is_copy_assignable_v && !regular, ""); #endif // !TEST_COMPILER(MSVC) || TEST_STD_VER > 2017 static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); static_assert(!regular, ""); // not equality_comparable static_assert(!regular, ""); static_assert(!regular, ""); struct is_equality_comparable { __host__ __device__ bool operator==(is_equality_comparable const&) const { return true; } __host__ __device__ bool operator!=(is_equality_comparable const&) const { return false; } }; static_assert(regular, ""); int main(int, char**) { return 0; }