From 2c477cb41afd22162ab5ac671eea3cb78cdc2d6c Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Mon, 13 Feb 2017 22:44:39 +0000 Subject: [PATCH] Add tests for noexcept functions git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294995 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../meta.unary.cat/is_function.pass.cpp | 42 ++-- .../meta.unary.cat/is_member_pointer.pass.cpp | 6 + .../member_function_pointer.pass.cpp | 221 ++++++++++++------ 3 files changed, 183 insertions(+), 86 deletions(-) diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp index 32e4f06be..c340ba69c 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp @@ -13,6 +13,7 @@ #include #include // for std::nullptr_t + #include "test_macros.h" template @@ -79,22 +80,27 @@ int main() test_is_function(); test_is_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); // function pointer is not a function - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); - test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); // function pointer is not a function + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + test_is_not_function(); + +#if TEST_STD_VER >= 11 + test_is_function(); + test_is_function(); +#endif } diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp index d4043f48f..a63a88c4d 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_member_pointer.pass.cpp @@ -97,4 +97,10 @@ int main() test_is_not_member_pointer(); test_is_not_member_pointer(); test_is_not_member_pointer(); + +#if TEST_STD_VER >= 11 + test_is_member_pointer(); + test_is_member_pointer(); + test_is_member_pointer(); +#endif } diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp index a895a8d44..691c549b5 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp @@ -52,90 +52,175 @@ struct incomplete_type; int main() { - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); // reference qualifiers on functions are a C++11 extension #if TEST_STD_VER >= 11 - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + // Noexcept qualifiers + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - // RValue qualifiers - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + // lvalue qualifiers + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); - test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + // Lvalue qualifiers with noexcept + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + // RValue qualifiers + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + // RValue qualifiers with noexcept + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); + test_member_function_pointer(); #endif // LWG#2582 - static_assert(!std::is_member_function_pointer::value, ""); + static_assert(!std::is_member_function_pointer::value, ""); }