diff options
Diffstat (limited to 'libcxx/test/std/utilities/function.objects')
| -rw-r--r-- | libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp index 136b15b2a2a..c8f4178a26b 100644 --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp @@ -16,7 +16,6 @@ // Allow incomplete argument types in the __is_callable check #include <functional> -#include <cassert> struct X{ typedef std::function<void(X&)> callback_type; @@ -25,40 +24,6 @@ private: callback_type _cb; }; -struct IncompleteReturnType { - std::function<IncompleteReturnType ()> fn; -}; - - -int called = 0; -IncompleteReturnType test_fn() { - ++called; - IncompleteReturnType I; - return I; -} - -// See llvm.org/PR34298 -void test_pr34298() +int main() { - static_assert(std::is_copy_constructible<IncompleteReturnType>::value, ""); - static_assert(std::is_copy_assignable<IncompleteReturnType>::value, ""); - { - IncompleteReturnType X; - X.fn = test_fn; - const IncompleteReturnType& CX = X; - IncompleteReturnType X2 = CX; - assert(X2.fn); - assert(called == 0); - X2.fn(); - assert(called == 1); - } - { - const IncompleteReturnType Empty; - IncompleteReturnType X2 = Empty; - assert(!X2.fn); - } -} - -int main() { - test_pr34298(); } |

