Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-09-11 02:37:47 +0300
committerEric Fiselier <eric@efcs.ca>2017-09-11 02:37:47 +0300
commit85cde7d2f410353ee5c143ad931da571e9be11bf (patch)
tree7c1f758b0e811d05d7a28fbe52a6038cc0a29fd5 /libcxx/test/std/utilities
parent358ca0c04bc297a9d34577d19e8814b0ca2e9411 (diff)
Revert "Fix PR34298 - Allow std::function with an incomplete return type."
This reverts commit r312890 because the test case fails to compile for older versions of Clang that reject initializing a const object without a user defined constructor. Since this patch should go into 5.0.1, I want to keep it an atomic change, and will re-commit it with a fixed test case. llvm-svn: 312891
Diffstat (limited to 'libcxx/test/std/utilities')
-rw-r--r--libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_incomplete.pass.cpp37
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 136b15b2a2a7..c8f4178a26bd 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();
}