summaryrefslogtreecommitdiffstats
path: root/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con')
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp2
-rw-r--r--libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp2
12 files changed, 12 insertions, 12 deletions
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
index 1cce025809b..06368fe3e89 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function(nullptr_t); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); } { std::function<int(const A*, int)> f = &A::foo; assert(f); assert(new_called == 0); assert(f.target<int (A::*)(int) const>() != 0); } } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function(nullptr_t); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); } { std::function<int(const A*, int)> f = &A::foo; assert(f); assert(new_called == 0); assert(f.target<int (A::*)(int) const>() != 0); } } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
index 9b090f3e5b9..2d6ab4b94cf 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // template<class F> // requires CopyConstructible<F> && Callable<F, ArgTypes..> // && Convertible<Callable<F, ArgTypes...>::result_type // operator=(F f); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f; f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f; f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f; f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); } { std::function<int(const A*, int)> f; f = &A::foo; assert(f); assert(new_called == 0); assert(f.target<int (A::*)(int) const>() != 0); } } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // template<class F> // requires CopyConstructible<F> && Callable<F, ArgTypes..> // && Convertible<Callable<F, ArgTypes...>::result_type // operator=(F f); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } int foo(int) const {return 1;} }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f; f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f; f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f; f = (int (*)(int))0; assert(!f); assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); } { std::function<int(const A*, int)> f; f = &A::foo; assert(f); assert(new_called == 0); assert(f.target<int (A::*)(int) const>() != 0); } } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
index bf2b3318650..c6628718576 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc.pass.cpp
@@ -1,6 +1,6 @@
//===----------------------------------------------------------------------===//
//
-// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
index e3a1e7b2b90..01ffad74de8 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_F.pass.cpp
@@ -1,6 +1,6 @@
//===----------------------------------------------------------------------===//
//
-// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
index 3b55eb8df10..893949cc655 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_function.pass.cpp
@@ -1,6 +1,6 @@
//===----------------------------------------------------------------------===//
//
-// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
index 28edd858f82..048b7f6bd5c 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_nullptr.pass.cpp
@@ -1,6 +1,6 @@
//===----------------------------------------------------------------------===//
//
-// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
index 2facbf7b59d..15e4dad2323 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
@@ -1,6 +1,6 @@
//===----------------------------------------------------------------------===//
//
-// ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure
+// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp
index 78dcc58d84c..d41975262fd 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function(const function& f); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); std::function<int(int)> f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>()); assert(f2.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f; assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); std::function<int(int)> f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>() == 0); assert(f2.target<A>() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); assert(f.target<int(*)(int)>() == 0); } #endif } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function(const function& f); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); std::function<int(int)> f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>()); assert(f2.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f; assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); std::function<int(int)> f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>() == 0); assert(f2.target<A>() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); assert(f.target<int(*)(int)>() == 0); } #endif } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
index 2b168064e9f..2dc88a93c84 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function& operator=(const function& f); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2; f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); std::function<int(int)> f2; f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>()); assert(f2.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f; assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); std::function<int(int)> f2; f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>() == 0); assert(f2.target<A>() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2; f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); assert(f.target<int(*)(int)>() == 0); } #endif } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function& operator=(const function& f); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2; f2 = f; assert(A::count == 2); assert(new_called == 2); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); } assert(A::count == 0); assert(new_called == 0); { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); std::function<int(int)> f2; f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>()); assert(f2.target<A>() == 0); } assert(new_called == 0); { std::function<int(int)> f; assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); std::function<int(int)> f2; f2 = f; assert(new_called == 0); assert(f2.target<int(*)(int)>() == 0); assert(f2.target<A>() == 0); } #ifdef _LIBCPP_MOVE assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); assert(f.target<int(*)(int)>() == 0); std::function<int(int)> f2; f2 = _STD::move(f); assert(A::count == 1); assert(new_called == 1); assert(f2.target<A>()); assert(f2.target<int(*)(int)>() == 0); assert(f.target<A>() == 0); assert(f.target<int(*)(int)>() == 0); } #endif } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp
index b63544fc1d7..98e11620cfb 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // explicit function(); #include <functional> #include <cassert> int main() { std::function<int(int)> f; assert(!f); } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // explicit function(); #include <functional> #include <cassert> int main() { std::function<int(int)> f; assert(!f); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp
index e493ccfdb72..e812070ff0f 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function(nullptr_t); #include <functional> #include <cassert> int main() { std::function<int(int)> f(nullptr); assert(!f); } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function(nullptr_t); #include <functional> #include <cassert> int main() { std::function<int(int)> f(nullptr); assert(!f); } \ No newline at end of file
diff --git a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp
index 4361d4a4a50..aa00a04f16e 100644
--- a/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp
@@ -1 +1 @@
-//===----------------------------------------------------------------------===// // // ΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚΚThe LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function& operator=(nullptr_t); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); f = nullptr; assert(A::count == 0); assert(new_called == 0); assert(f.target<A>() == 0); } { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); f = nullptr; assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); } } \ No newline at end of file
+//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // <functional> // class function<R(ArgTypes...)> // function& operator=(nullptr_t); #include <functional> #include <new> #include <cstdlib> #include <cassert> int new_called = 0; void* operator new(std::size_t s) throw(std::bad_alloc) { ++new_called; return std::malloc(s); } void operator delete(void* p) throw() { --new_called; std::free(p); } class A { int data_[10]; public: static int count; A() { ++count; for (int i = 0; i < 10; ++i) data_[i] = i; } A(const A&) {++count;} ~A() {--count;} int operator()(int i) const { for (int j = 0; j < 10; ++j) i += data_[j]; return i; } }; int A::count = 0; int g(int) {return 0;} int main() { assert(new_called == 0); { std::function<int(int)> f = A(); assert(A::count == 1); assert(new_called == 1); assert(f.target<A>()); f = nullptr; assert(A::count == 0); assert(new_called == 0); assert(f.target<A>() == 0); } { std::function<int(int)> f = g; assert(new_called == 0); assert(f.target<int(*)(int)>()); assert(f.target<A>() == 0); f = nullptr; assert(new_called == 0); assert(f.target<int(*)(int)>() == 0); } } \ No newline at end of file
OpenPOWER on IntegriCloud