//===----------------------------------------------------------------------===// // // 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++98, c++03, c++11, c++14, c++17 #include #include "test_macros.h" struct A {}; struct B { public: operator A() { return a; } A a; }; class C { }; class D { public: operator C() noexcept { return c; } C c; }; int main(int, char**) { static_assert((std::is_nothrow_convertible::value), ""); static_assert(!(std::is_nothrow_convertible::value), ""); static_assert(!(std::is_nothrow_convertible::value), ""); static_assert((std::is_nothrow_convertible::value), ""); static_assert((std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert((std::is_nothrow_convertible_v), ""); static_assert((std::is_nothrow_convertible_v), ""); static_assert((std::is_nothrow_convertible_v), ""); static_assert((std::is_nothrow_convertible_v), ""); static_assert((std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); typedef void V(); typedef int I(); static_assert(!(std::is_nothrow_convertible_v), ""); static_assert(!(std::is_nothrow_convertible_v), ""); return 0; }