Forráskód Böngészése

Fixing whitespace problems

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@111767 91177308-0d34-0410-b5e6-96231b3b80d8
Howard Hinnant 15 éve
szülő
commit
c52f43e72d
100 módosított fájl, 3110 hozzáadás és 91 törlés
  1. 37 1
      test/utilities/date.time/tested_elsewhere.pass.cpp
  2. 24 1
      test/utilities/function.objects/arithmetic.operations/divides.pass.cpp
  3. 24 1
      test/utilities/function.objects/arithmetic.operations/minus.pass.cpp
  4. 24 1
      test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp
  5. 24 1
      test/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp
  6. 24 1
      test/utilities/function.objects/arithmetic.operations/negate.pass.cpp
  7. 24 1
      test/utilities/function.objects/arithmetic.operations/plus.pass.cpp
  8. 12 1
      test/utilities/function.objects/base/nothing_to_do.pass.cpp
  9. 53 1
      test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp
  10. 0 0
      test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp
  11. 0 0
      test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp
  12. 59 1
      test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp
  13. 32 1
      test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp
  14. 41 1
      test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp
  15. 36 1
      test/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp
  16. 12 1
      test/utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp
  17. 12 1
      test/utilities/function.objects/bind/nothing_to_do.pass.cpp
  18. 28 1
      test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp
  19. 28 1
      test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp
  20. 28 1
      test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp
  21. 25 1
      test/utilities/function.objects/comparisons/equal_to.pass.cpp
  22. 26 1
      test/utilities/function.objects/comparisons/greater.pass.cpp
  23. 26 1
      test/utilities/function.objects/comparisons/greater_equal.pass.cpp
  24. 26 1
      test/utilities/function.objects/comparisons/less.pass.cpp
  25. 26 1
      test/utilities/function.objects/comparisons/less_equal.pass.cpp
  26. 25 1
      test/utilities/function.objects/comparisons/not_equal_to.pass.cpp
  27. 12 1
      test/utilities/function.objects/func.def/nothing_to_do.pass.cpp
  28. 42 1
      test/utilities/function.objects/func.memfn/member_data.fail.cpp
  29. 41 1
      test/utilities/function.objects/func.memfn/member_data.pass.cpp
  30. 66 1
      test/utilities/function.objects/func.memfn/member_function.pass.cpp
  31. 72 1
      test/utilities/function.objects/func.memfn/member_function_const.pass.cpp
  32. 72 1
      test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp
  33. 72 1
      test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp
  34. 23 1
      test/utilities/function.objects/func.require/binary_function.pass.cpp
  35. 22 1
      test/utilities/function.objects/func.require/unary_function.pass.cpp
  36. 26 1
      test/utilities/function.objects/func.wrap/func.wrap.badcall/bad_function_call.pass.cpp
  37. 20 1
      test/utilities/function.objects/func.wrap/func.wrap.badcall/func.wrap.badcall.const/bad_function_call_ctor.pass.cpp
  38. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp
  39. 29 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp
  40. 98 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp
  41. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
  42. 1 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp
  43. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp
  44. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp
  45. 23 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp
  46. 23 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp
  47. 86 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp
  48. 46 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp
  49. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp
  50. 58 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp
  51. 67 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp
  52. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp
  53. 41 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp
  54. 89 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp
  55. 61 1
      test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp
  56. 3 3
      test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h
  57. 0 0
      test/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp
  58. 12 1
      test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp
  59. 26 1
      test/utilities/function.objects/function.pointer.adaptors/pointer_to_binary_function.pass.cpp
  60. 26 1
      test/utilities/function.objects/function.pointer.adaptors/pointer_to_unary_function.pass.cpp
  61. 25 1
      test/utilities/function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp
  62. 25 1
      test/utilities/function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp
  63. 27 1
      test/utilities/function.objects/logical.operations/logical_and.pass.cpp
  64. 25 1
      test/utilities/function.objects/logical.operations/logical_not.pass.cpp
  65. 27 1
      test/utilities/function.objects/logical.operations/logical_or.pass.cpp
  66. 31 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp
  67. 31 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp
  68. 33 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
  69. 33 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp
  70. 31 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp
  71. 31 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
  72. 33 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
  73. 33 1
      test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp
  74. 31 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp
  75. 31 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp
  76. 33 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
  77. 33 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp
  78. 31 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp
  79. 31 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp
  80. 33 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp
  81. 33 1
      test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp
  82. 27 1
      test/utilities/function.objects/negators/binary_negate.pass.cpp
  83. 22 1
      test/utilities/function.objects/negators/not1.pass.cpp
  84. 24 1
      test/utilities/function.objects/negators/not2.pass.cpp
  85. 25 1
      test/utilities/function.objects/negators/unary_negate.pass.cpp
  86. 0 0
      test/utilities/function.objects/refwrap/binary.pass.cpp
  87. 46 1
      test/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
  88. 58 1
      test/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
  89. 46 1
      test/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
  90. 22 1
      test/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp
  91. 45 1
      test/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
  92. 24 1
      test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp
  93. 25 1
      test/utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp
  94. 27 1
      test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp
  95. 24 1
      test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp
  96. 25 1
      test/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp
  97. 52 1
      test/utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp
  98. 0 0
      test/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp
  99. 76 1
      test/utilities/function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp
  100. 68 1
      test/utilities/function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp

+ 37 - 1
test/utilities/date.time/tested_elsewhere.pass.cpp

@@ -1 +1,37 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <ctime>
#include <type_traits>

#ifndef NULL
#error NULL not defined
#endif

#ifndef CLOCKS_PER_SEC
#error CLOCKS_PER_SEC not defined
#endif

int main()
{
    std::clock_t c = 0;
    std::size_t s = 0;
    std::time_t t = 0;
    std::tm tm = {0};
    char str[3];
    static_assert((std::is_same<decltype(std::clock()), std::clock_t>::value), "");
    static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
    static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
    static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
    static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), "");
    static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), "");
    static_assert((std::is_same<decltype(std::gmtime(&t)), std::tm*>::value), "");
    static_assert((std::is_same<decltype(std::localtime(&t)), std::tm*>::value), "");
    static_assert((std::is_same<decltype(std::strftime(str,s,"",&tm)), std::size_t>::value), "");
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <ctime>
+#include <type_traits>
+
+#ifndef NULL
+#error NULL not defined
+#endif
+
+#ifndef CLOCKS_PER_SEC
+#error CLOCKS_PER_SEC not defined
+#endif
+
+int main()
+{
+    std::clock_t c = 0;
+    std::size_t s = 0;
+    std::time_t t = 0;
+    std::tm tm = {0};
+    char str[3];
+    static_assert((std::is_same<decltype(std::clock()), std::clock_t>::value), "");
+    static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
+    static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
+    static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
+    static_assert((std::is_same<decltype(std::asctime(&tm)), char*>::value), "");
+    static_assert((std::is_same<decltype(std::ctime(&t)), char*>::value), "");
+    static_assert((std::is_same<decltype(std::gmtime(&t)), std::tm*>::value), "");
+    static_assert((std::is_same<decltype(std::localtime(&t)), std::tm*>::value), "");
+    static_assert((std::is_same<decltype(std::strftime(str,s,"",&tm)), std::size_t>::value), "");
+}

+ 24 - 1
test/utilities/function.objects/arithmetic.operations/divides.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// divides

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::divides<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(36, 4) == 9);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// divides
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::divides<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(36, 4) == 9);
+}

+ 24 - 1
test/utilities/function.objects/arithmetic.operations/minus.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// minus

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::minus<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(3, 2) == 1);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// minus
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::minus<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(3, 2) == 1);
+}

+ 24 - 1
test/utilities/function.objects/arithmetic.operations/modulus.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// modulus

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::modulus<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(36, 8) == 4);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// modulus
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::modulus<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(36, 8) == 4);
+}

+ 24 - 1
test/utilities/function.objects/arithmetic.operations/multiplies.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// multiplies

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::multiplies<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(3, 2) == 6);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// multiplies
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::multiplies<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(3, 2) == 6);
+}

+ 24 - 1
test/utilities/function.objects/arithmetic.operations/negate.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// negate

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::negate<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::unary_function<int, int>, F>::value), "");
    assert(f(36) == -36);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// negate
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::negate<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::unary_function<int, int>, F>::value), "");
+    assert(f(36) == -36);
+}

+ 24 - 1
test/utilities/function.objects/arithmetic.operations/plus.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// plus

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::plus<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(3, 2) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// plus
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::plus<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(3, 2) == 5);
+}

+ 12 - 1
test/utilities/function.objects/base/nothing_to_do.pass.cpp

@@ -1 +1,12 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

int main()
{
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

+ 53 - 1
test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_int_0.pass.cpp

@@ -1 +1,53 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<CopyConstructible Fn, CopyConstructible... Types> 
//   unspecified bind(Fn, Types...); 
// template<Returnable R, CopyConstructible Fn, CopyConstructible... Types> 
//   unspecified bind(Fn, Types...); 

#include <functional>
#include <cassert>

template <class R, class F>
void
test(F f, R expected)
{
    assert(f() == expected);
}

template <class R, class F>
void
test_const(const F& f, R expected)
{
    assert(f() == expected);
}

int f() {return 1;}

struct A_int_0
{
    int operator()() {return 4;}
    int operator()() const {return 5;}
};

int main()
{
    test(std::bind(f), 1);
    test(std::bind(&f), 1);
    test(std::bind(A_int_0()), 4);
    test_const(std::bind(A_int_0()), 5);

    test(std::bind<int>(f), 1);
    test(std::bind<int>(&f), 1);
    test(std::bind<int>(A_int_0()), 4);
    test_const(std::bind<int>(A_int_0()), 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<CopyConstructible Fn, CopyConstructible... Types>
+//   unspecified bind(Fn, Types...);
+// template<Returnable R, CopyConstructible Fn, CopyConstructible... Types>
+//   unspecified bind(Fn, Types...);
+
+#include <functional>
+#include <cassert>
+
+template <class R, class F>
+void
+test(F f, R expected)
+{
+    assert(f() == expected);
+}
+
+template <class R, class F>
+void
+test_const(const F& f, R expected)
+{
+    assert(f() == expected);
+}
+
+int f() {return 1;}
+
+struct A_int_0
+{
+    int operator()() {return 4;}
+    int operator()() const {return 5;}
+};
+
+int main()
+{
+    test(std::bind(f), 1);
+    test(std::bind(&f), 1);
+    test(std::bind(A_int_0()), 4);
+    test_const(std::bind(A_int_0()), 5);
+
+    test(std::bind<int>(f), 1);
+    test(std::bind<int>(&f), 1);
+    test(std::bind<int>(A_int_0()), 4);
+    test_const(std::bind<int>(A_int_0()), 5);
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_lvalue.pass.cpp


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_rvalue.pass.cpp


+ 59 - 1
test/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp

@@ -1 +1,59 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<CopyConstructible Fn, CopyConstructible... Types> 
//   unspecified bind(Fn, Types...); 
// template<Returnable R, CopyConstructible Fn, CopyConstructible... Types> 
//   unspecified bind(Fn, Types...); 

#include <functional>
#include <cassert>

int count = 0;

template <class F>
void
test(F f)
{
    int save_count = count;
    f();
    assert(count == save_count + 1);
}

template <class F>
void
test_const(const F& f)
{
    int save_count = count;
    f();
    assert(count == save_count + 2);
}

void f() {++count;}

struct A_int_0
{
    void operator()() {++count;}
    void operator()() const {count += 2;}
};

int main()
{
    test(std::bind(f));
    test(std::bind(&f));
    test(std::bind(A_int_0()));
    test_const(std::bind(A_int_0()));

    test(std::bind<void>(f));
    test(std::bind<void>(&f));
    test(std::bind<void>(A_int_0()));
    test_const(std::bind<void>(A_int_0()));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<CopyConstructible Fn, CopyConstructible... Types>
+//   unspecified bind(Fn, Types...);
+// template<Returnable R, CopyConstructible Fn, CopyConstructible... Types>
+//   unspecified bind(Fn, Types...);
+
+#include <functional>
+#include <cassert>
+
+int count = 0;
+
+template <class F>
+void
+test(F f)
+{
+    int save_count = count;
+    f();
+    assert(count == save_count + 1);
+}
+
+template <class F>
+void
+test_const(const F& f)
+{
+    int save_count = count;
+    f();
+    assert(count == save_count + 2);
+}
+
+void f() {++count;}
+
+struct A_int_0
+{
+    void operator()() {++count;}
+    void operator()() const {count += 2;}
+};
+
+int main()
+{
+    test(std::bind(f));
+    test(std::bind(&f));
+    test(std::bind(A_int_0()));
+    test_const(std::bind(A_int_0()));
+
+    test(std::bind<void>(f));
+    test(std::bind<void>(&f));
+    test(std::bind<void>(A_int_0()));
+    test_const(std::bind<void>(A_int_0()));
+}

+ 32 - 1
test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_bind_expression.pass.cpp

@@ -1 +1,32 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<class T> struct is_bind_expression

#include <functional>

template <bool Expected, class T>
void
test(const T&)
{
    static_assert(std::is_bind_expression<T>::value == Expected, "");
}

struct C {};

int main()
{
    test<true>(std::bind(C()));
    test<true>(std::bind(C(), std::placeholders::_2));
    test<true>(std::bind<int>(C()));
    test<false>(1);
    test<false>(std::placeholders::_2);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<class T> struct is_bind_expression
+
+#include <functional>
+
+template <bool Expected, class T>
+void
+test(const T&)
+{
+    static_assert(std::is_bind_expression<T>::value == Expected, "");
+}
+
+struct C {};
+
+int main()
+{
+    test<true>(std::bind(C()));
+    test<true>(std::bind(C(), std::placeholders::_2));
+    test<true>(std::bind<int>(C()));
+    test<false>(1);
+    test<false>(std::placeholders::_2);
+}

+ 41 - 1
test/utilities/function.objects/bind/func.bind/func.bind.isbind/is_placeholder.pass.cpp

@@ -1 +1,41 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// struct is_placeholder

#include <functional>

template <int Expected, class T>
void
test(const T&)
{
    static_assert(std::is_placeholder<T>::value == Expected, "");
}

struct C {};

int main()
{
    test<1>(std::placeholders::_1);
    test<2>(std::placeholders::_2);
    test<3>(std::placeholders::_3);
    test<4>(std::placeholders::_4);
    test<5>(std::placeholders::_5);
    test<6>(std::placeholders::_6);
    test<7>(std::placeholders::_7);
    test<8>(std::placeholders::_8);
    test<9>(std::placeholders::_9);
    test<10>(std::placeholders::_10);
    test<0>(4);
    test<0>(5.5);
    test<0>('a');
    test<0>(C());
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// struct is_placeholder
+
+#include <functional>
+
+template <int Expected, class T>
+void
+test(const T&)
+{
+    static_assert(std::is_placeholder<T>::value == Expected, "");
+}
+
+struct C {};
+
+int main()
+{
+    test<1>(std::placeholders::_1);
+    test<2>(std::placeholders::_2);
+    test<3>(std::placeholders::_3);
+    test<4>(std::placeholders::_4);
+    test<5>(std::placeholders::_5);
+    test<6>(std::placeholders::_6);
+    test<7>(std::placeholders::_7);
+    test<8>(std::placeholders::_8);
+    test<9>(std::placeholders::_9);
+    test<10>(std::placeholders::_10);
+    test<0>(4);
+    test<0>(5.5);
+    test<0>('a');
+    test<0>(C());
+}

+ 36 - 1
test/utilities/function.objects/bind/func.bind/func.bind.place/placeholders.pass.cpp

@@ -1 +1,36 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// placeholders

#include <functional>

template <class T>
void
test(const T& t)
{
    T t2;
    T t3 = t;
}

int main()
{
    test(std::placeholders::_1);
    test(std::placeholders::_2);
    test(std::placeholders::_3);
    test(std::placeholders::_4);
    test(std::placeholders::_5);
    test(std::placeholders::_6);
    test(std::placeholders::_7);
    test(std::placeholders::_8);
    test(std::placeholders::_9);
    test(std::placeholders::_10);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// placeholders
+
+#include <functional>
+
+template <class T>
+void
+test(const T& t)
+{
+    T t2;
+    T t3 = t;
+}
+
+int main()
+{
+    test(std::placeholders::_1);
+    test(std::placeholders::_2);
+    test(std::placeholders::_3);
+    test(std::placeholders::_4);
+    test(std::placeholders::_5);
+    test(std::placeholders::_6);
+    test(std::placeholders::_7);
+    test(std::placeholders::_8);
+    test(std::placeholders::_9);
+    test(std::placeholders::_10);
+}

+ 12 - 1
test/utilities/function.objects/bind/func.bind/nothing_to_do.pass.cpp

@@ -1 +1,12 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

int main()
{
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

+ 12 - 1
test/utilities/function.objects/bind/nothing_to_do.pass.cpp

@@ -1 +1,12 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

int main()
{
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

+ 28 - 1
test/utilities/function.objects/bitwise.operations/bit_and.pass.cpp

@@ -1 +1,28 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// bit_and

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::bit_and<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(0xEA95, 0xEA95) == 0xEA95);
    assert(f(0xEA95, 0x58D3) == 0x4891);
    assert(f(0x58D3, 0xEA95) == 0x4891);
    assert(f(0x58D3, 0) == 0);
    assert(f(0xFFFF, 0x58D3) == 0x58D3);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// bit_and
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::bit_and<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(0xEA95, 0xEA95) == 0xEA95);
+    assert(f(0xEA95, 0x58D3) == 0x4891);
+    assert(f(0x58D3, 0xEA95) == 0x4891);
+    assert(f(0x58D3, 0) == 0);
+    assert(f(0xFFFF, 0x58D3) == 0x58D3);
+}

+ 28 - 1
test/utilities/function.objects/bitwise.operations/bit_or.pass.cpp

@@ -1 +1,28 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// bit_or

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::bit_or<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(0xEA95, 0xEA95) == 0xEA95);
    assert(f(0xEA95, 0x58D3) == 0xFAD7);
    assert(f(0x58D3, 0xEA95) == 0xFAD7);
    assert(f(0x58D3, 0) == 0x58D3);
    assert(f(0xFFFF, 0x58D3) == 0xFFFF);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// bit_or
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::bit_or<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(0xEA95, 0xEA95) == 0xEA95);
+    assert(f(0xEA95, 0x58D3) == 0xFAD7);
+    assert(f(0x58D3, 0xEA95) == 0xFAD7);
+    assert(f(0x58D3, 0) == 0x58D3);
+    assert(f(0xFFFF, 0x58D3) == 0xFFFF);
+}

+ 28 - 1
test/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp

@@ -1 +1,28 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// bit_xor

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::bit_xor<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
    assert(f(0xEA95, 0xEA95) == 0);
    assert(f(0xEA95, 0x58D3) == 0xB246);
    assert(f(0x58D3, 0xEA95) == 0xB246);
    assert(f(0x58D3, 0) == 0x58D3);
    assert(f(0xFFFF, 0x58D3) == 0xA72C);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// bit_xor
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::bit_xor<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, int>, F>::value), "");
+    assert(f(0xEA95, 0xEA95) == 0);
+    assert(f(0xEA95, 0x58D3) == 0xB246);
+    assert(f(0x58D3, 0xEA95) == 0xB246);
+    assert(f(0x58D3, 0) == 0x58D3);
+    assert(f(0xFFFF, 0x58D3) == 0xA72C);
+}

+ 25 - 1
test/utilities/function.objects/comparisons/equal_to.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// equal_to

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::equal_to<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(f(36, 36));
    assert(!f(36, 6));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// equal_to
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::equal_to<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(f(36, 36));
+    assert(!f(36, 6));
+}

+ 26 - 1
test/utilities/function.objects/comparisons/greater.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// greater

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::greater<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(!f(36, 36));
    assert(f(36, 6));
    assert(!f(6, 36));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// greater
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::greater<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(!f(36, 36));
+    assert(f(36, 6));
+    assert(!f(6, 36));
+}

+ 26 - 1
test/utilities/function.objects/comparisons/greater_equal.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// greater_equal

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::greater_equal<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(f(36, 36));
    assert(f(36, 6));
    assert(!f(6, 36));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// greater_equal
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::greater_equal<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(f(36, 36));
+    assert(f(36, 6));
+    assert(!f(6, 36));
+}

+ 26 - 1
test/utilities/function.objects/comparisons/less.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// less

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::less<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(!f(36, 36));
    assert(!f(36, 6));
    assert(f(6, 36));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// less
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::less<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(!f(36, 36));
+    assert(!f(36, 6));
+    assert(f(6, 36));
+}

+ 26 - 1
test/utilities/function.objects/comparisons/less_equal.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// less_equal

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::less_equal<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(f(36, 36));
    assert(!f(36, 6));
    assert(f(6, 36));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// less_equal
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::less_equal<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(f(36, 36));
+    assert(!f(36, 6));
+    assert(f(6, 36));
+}

+ 25 - 1
test/utilities/function.objects/comparisons/not_equal_to.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// not_equal_to

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::not_equal_to<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(!f(36, 36));
    assert(f(36, 6));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// not_equal_to
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::not_equal_to<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(!f(36, 36));
+    assert(f(36, 6));
+}

+ 12 - 1
test/utilities/function.objects/func.def/nothing_to_do.pass.cpp

@@ -1 +1,12 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

int main()
{
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

+ 42 - 1
test/utilities/function.objects/func.memfn/member_data.fail.cpp

@@ -1 +1,42 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable R, class T> unspecified mem_fn(R T::* pm);

#include <functional>
#include <cassert>

struct A
{
    double data_;
};

template <class F>
void
test(F f)
{
    {
    A a;
    f(a) = 5;
    assert(a.data_ == 5);
    A* ap = &a;
    f(ap) = 6;
    assert(a.data_ == 6);
    const A* cap = ap;
    assert(f(cap) == f(ap));
    f(cap) = 7;
    }
}

int main()
{
    test(std::mem_fn(&A::data_));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable R, class T> unspecified mem_fn(R T::* pm);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    double data_;
+};
+
+template <class F>
+void
+test(F f)
+{
+    {
+    A a;
+    f(a) = 5;
+    assert(a.data_ == 5);
+    A* ap = &a;
+    f(ap) = 6;
+    assert(a.data_ == 6);
+    const A* cap = ap;
+    assert(f(cap) == f(ap));
+    f(cap) = 7;
+    }
+}
+
+int main()
+{
+    test(std::mem_fn(&A::data_));
+}

+ 41 - 1
test/utilities/function.objects/func.memfn/member_data.pass.cpp

@@ -1 +1,41 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable R, class T> unspecified mem_fn(R T::* pm);

#include <functional>
#include <cassert>

struct A
{
    double data_;
};

template <class F>
void
test(F f)
{
    {
    A a;
    f(a) = 5;
    assert(a.data_ == 5);
    A* ap = &a;
    f(ap) = 6;
    assert(a.data_ == 6);
    const A* cap = ap;
    assert(f(cap) == f(ap));
    }
}

int main()
{
    test(std::mem_fn(&A::data_));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable R, class T> unspecified mem_fn(R T::* pm);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    double data_;
+};
+
+template <class F>
+void
+test(F f)
+{
+    {
+    A a;
+    f(a) = 5;
+    assert(a.data_ == 5);
+    A* ap = &a;
+    f(ap) = 6;
+    assert(a.data_ == 6);
+    const A* cap = ap;
+    assert(f(cap) == f(ap));
+    }
+}
+
+int main()
+{
+    test(std::mem_fn(&A::data_));
+}

+ 66 - 1
test/utilities/function.objects/func.memfn/member_function.pass.cpp

@@ -1 +1,66 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable R, class T, CopyConstructible... Args> 
//   unspecified mem_fn(R (T::* pm)(Args...)); 

#include <functional>
#include <cassert>

struct A
{
    char test0() {return 'a';}
    char test1(int) {return 'b';}
    char test2(int, double) {return 'c';}
};

template <class F>
void
test0(F f)
{
    {
    A a;
    assert(f(a) == 'a');
    A* ap = &a;
    assert(f(ap) == 'a');
    }
}

template <class F>
void
test1(F f)
{
    {
    A a;
    assert(f(a, 1) == 'b');
    A* ap = &a;
    assert(f(ap, 2) == 'b');
    }
}

template <class F>
void
test2(F f)
{
    {
    A a;
    assert(f(a, 1, 2) == 'c');
    A* ap = &a;
    assert(f(ap, 2, 3.5) == 'c');
    }
}

int main()
{
    test0(std::mem_fn(&A::test0));
    test1(std::mem_fn(&A::test1));
    test2(std::mem_fn(&A::test2));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable R, class T, CopyConstructible... Args>
+//   unspecified mem_fn(R (T::* pm)(Args...));
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char test0() {return 'a';}
+    char test1(int) {return 'b';}
+    char test2(int, double) {return 'c';}
+};
+
+template <class F>
+void
+test0(F f)
+{
+    {
+    A a;
+    assert(f(a) == 'a');
+    A* ap = &a;
+    assert(f(ap) == 'a');
+    }
+}
+
+template <class F>
+void
+test1(F f)
+{
+    {
+    A a;
+    assert(f(a, 1) == 'b');
+    A* ap = &a;
+    assert(f(ap, 2) == 'b');
+    }
+}
+
+template <class F>
+void
+test2(F f)
+{
+    {
+    A a;
+    assert(f(a, 1, 2) == 'c');
+    A* ap = &a;
+    assert(f(ap, 2, 3.5) == 'c');
+    }
+}
+
+int main()
+{
+    test0(std::mem_fn(&A::test0));
+    test1(std::mem_fn(&A::test1));
+    test2(std::mem_fn(&A::test2));
+}

+ 72 - 1
test/utilities/function.objects/func.memfn/member_function_const.pass.cpp

@@ -1 +1,72 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable R, class T, CopyConstructible... Args> 
//   unspecified mem_fn(R (T::* pm)(Args...) const); 

#include <functional>
#include <cassert>

struct A
{
    char test0() const {return 'a';}
    char test1(int) const {return 'b';}
    char test2(int, double) const {return 'c';}
};

template <class F>
void
test0(F f)
{
    {
    A a;
    assert(f(a) == 'a');
    A* ap = &a;
    assert(f(ap) == 'a');
    const A* cap = &a;
    assert(f(cap) == 'a');
    }
}

template <class F>
void
test1(F f)
{
    {
    A a;
    assert(f(a, 1) == 'b');
    A* ap = &a;
    assert(f(ap, 2) == 'b');
    const A* cap = &a;
    assert(f(cap, 2) == 'b');
    }
}

template <class F>
void
test2(F f)
{
    {
    A a;
    assert(f(a, 1, 2) == 'c');
    A* ap = &a;
    assert(f(ap, 2, 3.5) == 'c');
    const A* cap = &a;
    assert(f(cap, 2, 3.5) == 'c');
    }
}

int main()
{
    test0(std::mem_fn(&A::test0));
    test1(std::mem_fn(&A::test1));
    test2(std::mem_fn(&A::test2));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable R, class T, CopyConstructible... Args>
+//   unspecified mem_fn(R (T::* pm)(Args...) const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char test0() const {return 'a';}
+    char test1(int) const {return 'b';}
+    char test2(int, double) const {return 'c';}
+};
+
+template <class F>
+void
+test0(F f)
+{
+    {
+    A a;
+    assert(f(a) == 'a');
+    A* ap = &a;
+    assert(f(ap) == 'a');
+    const A* cap = &a;
+    assert(f(cap) == 'a');
+    }
+}
+
+template <class F>
+void
+test1(F f)
+{
+    {
+    A a;
+    assert(f(a, 1) == 'b');
+    A* ap = &a;
+    assert(f(ap, 2) == 'b');
+    const A* cap = &a;
+    assert(f(cap, 2) == 'b');
+    }
+}
+
+template <class F>
+void
+test2(F f)
+{
+    {
+    A a;
+    assert(f(a, 1, 2) == 'c');
+    A* ap = &a;
+    assert(f(ap, 2, 3.5) == 'c');
+    const A* cap = &a;
+    assert(f(cap, 2, 3.5) == 'c');
+    }
+}
+
+int main()
+{
+    test0(std::mem_fn(&A::test0));
+    test1(std::mem_fn(&A::test1));
+    test2(std::mem_fn(&A::test2));
+}

+ 72 - 1
test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp

@@ -1 +1,72 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable R, class T, CopyConstructible... Args> 
//   unspecified mem_fn(R (T::* pm)(Args...) const volatile); 

#include <functional>
#include <cassert>

struct A
{
    char test0() const volatile {return 'a';}
    char test1(int) const volatile {return 'b';}
    char test2(int, double) const volatile {return 'c';}
};

template <class F>
void
test0(F f)
{
    {
    A a;
    assert(f(a) == 'a');
    A* ap = &a;
    assert(f(ap) == 'a');
    const volatile A* cap = &a;
    assert(f(cap) == 'a');
    }
}

template <class F>
void
test1(F f)
{
    {
    A a;
    assert(f(a, 1) == 'b');
    A* ap = &a;
    assert(f(ap, 2) == 'b');
    const volatile A* cap = &a;
    assert(f(cap, 2) == 'b');
    }
}

template <class F>
void
test2(F f)
{
    {
    A a;
    assert(f(a, 1, 2) == 'c');
    A* ap = &a;
    assert(f(ap, 2, 3.5) == 'c');
    const volatile A* cap = &a;
    assert(f(cap, 2, 3.5) == 'c');
    }
}

int main()
{
    test0(std::mem_fn(&A::test0));
    test1(std::mem_fn(&A::test1));
    test2(std::mem_fn(&A::test2));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable R, class T, CopyConstructible... Args>
+//   unspecified mem_fn(R (T::* pm)(Args...) const volatile);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char test0() const volatile {return 'a';}
+    char test1(int) const volatile {return 'b';}
+    char test2(int, double) const volatile {return 'c';}
+};
+
+template <class F>
+void
+test0(F f)
+{
+    {
+    A a;
+    assert(f(a) == 'a');
+    A* ap = &a;
+    assert(f(ap) == 'a');
+    const volatile A* cap = &a;
+    assert(f(cap) == 'a');
+    }
+}
+
+template <class F>
+void
+test1(F f)
+{
+    {
+    A a;
+    assert(f(a, 1) == 'b');
+    A* ap = &a;
+    assert(f(ap, 2) == 'b');
+    const volatile A* cap = &a;
+    assert(f(cap, 2) == 'b');
+    }
+}
+
+template <class F>
+void
+test2(F f)
+{
+    {
+    A a;
+    assert(f(a, 1, 2) == 'c');
+    A* ap = &a;
+    assert(f(ap, 2, 3.5) == 'c');
+    const volatile A* cap = &a;
+    assert(f(cap, 2, 3.5) == 'c');
+    }
+}
+
+int main()
+{
+    test0(std::mem_fn(&A::test0));
+    test1(std::mem_fn(&A::test1));
+    test2(std::mem_fn(&A::test2));
+}

+ 72 - 1
test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp

@@ -1 +1,72 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable R, class T, CopyConstructible... Args> 
//   unspecified mem_fn(R (T::* pm)(Args...) volatile); 

#include <functional>
#include <cassert>

struct A
{
    char test0() volatile {return 'a';}
    char test1(int) volatile {return 'b';}
    char test2(int, double) volatile {return 'c';}
};

template <class F>
void
test0(F f)
{
    {
    A a;
    assert(f(a) == 'a');
    A* ap = &a;
    assert(f(ap) == 'a');
    volatile A* cap = &a;
    assert(f(cap) == 'a');
    }
}

template <class F>
void
test1(F f)
{
    {
    A a;
    assert(f(a, 1) == 'b');
    A* ap = &a;
    assert(f(ap, 2) == 'b');
    volatile A* cap = &a;
    assert(f(cap, 2) == 'b');
    }
}

template <class F>
void
test2(F f)
{
    {
    A a;
    assert(f(a, 1, 2) == 'c');
    A* ap = &a;
    assert(f(ap, 2, 3.5) == 'c');
    volatile A* cap = &a;
    assert(f(cap, 2, 3.5) == 'c');
    }
}

int main()
{
    test0(std::mem_fn(&A::test0));
    test1(std::mem_fn(&A::test1));
    test2(std::mem_fn(&A::test2));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable R, class T, CopyConstructible... Args>
+//   unspecified mem_fn(R (T::* pm)(Args...) volatile);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char test0() volatile {return 'a';}
+    char test1(int) volatile {return 'b';}
+    char test2(int, double) volatile {return 'c';}
+};
+
+template <class F>
+void
+test0(F f)
+{
+    {
+    A a;
+    assert(f(a) == 'a');
+    A* ap = &a;
+    assert(f(ap) == 'a');
+    volatile A* cap = &a;
+    assert(f(cap) == 'a');
+    }
+}
+
+template <class F>
+void
+test1(F f)
+{
+    {
+    A a;
+    assert(f(a, 1) == 'b');
+    A* ap = &a;
+    assert(f(ap, 2) == 'b');
+    volatile A* cap = &a;
+    assert(f(cap, 2) == 'b');
+    }
+}
+
+template <class F>
+void
+test2(F f)
+{
+    {
+    A a;
+    assert(f(a, 1, 2) == 'c');
+    A* ap = &a;
+    assert(f(ap, 2, 3.5) == 'c');
+    volatile A* cap = &a;
+    assert(f(cap, 2, 3.5) == 'c');
+    }
+}
+
+int main()
+{
+    test0(std::mem_fn(&A::test0));
+    test1(std::mem_fn(&A::test1));
+    test2(std::mem_fn(&A::test2));
+}

+ 23 - 1
test/utilities/function.objects/func.require/binary_function.pass.cpp

@@ -1 +1,23 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// binary_function

#include <functional>
#include <type_traits>

int main()
{
    typedef std::binary_function<int, short, bool> bf;
    static_assert((std::is_same<bf::first_argument_type, int>::value), "");
    static_assert((std::is_same<bf::second_argument_type, short>::value), "");
    static_assert((std::is_same<bf::result_type, bool>::value), "");
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// binary_function
+
+#include <functional>
+#include <type_traits>
+
+int main()
+{
+    typedef std::binary_function<int, short, bool> bf;
+    static_assert((std::is_same<bf::first_argument_type, int>::value), "");
+    static_assert((std::is_same<bf::second_argument_type, short>::value), "");
+    static_assert((std::is_same<bf::result_type, bool>::value), "");
+}

+ 22 - 1
test/utilities/function.objects/func.require/unary_function.pass.cpp

@@ -1 +1,22 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// unary_function

#include <functional>
#include <type_traits>

int main()
{
    typedef std::unary_function<int, bool> uf;
    static_assert((std::is_same<uf::argument_type, int>::value), "");
    static_assert((std::is_same<uf::result_type, bool>::value), "");
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// unary_function
+
+#include <functional>
+#include <type_traits>
+
+int main()
+{
+    typedef std::unary_function<int, bool> uf;
+    static_assert((std::is_same<uf::argument_type, int>::value), "");
+    static_assert((std::is_same<uf::result_type, bool>::value), "");
+}

+ 26 - 1
test/utilities/function.objects/func.wrap/func.wrap.badcall/bad_function_call.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// Class bad_function_call

// class bad_function_call
//     : public exception
// { 
// public: 
//   // 20.7.16.1.1, constructor: 
//   bad_function_call(); 
// };

#include <functional>
#include <type_traits>

int main()
{
    static_assert((std::is_base_of<std::exception, std::bad_function_call>::value), "");
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Class bad_function_call
+
+// class bad_function_call
+//     : public exception
+// {
+// public:
+//   // 20.7.16.1.1, constructor:
+//   bad_function_call();
+// };
+
+#include <functional>
+#include <type_traits>
+
+int main()
+{
+    static_assert((std::is_base_of<std::exception, std::bad_function_call>::value), "");
+}

+ 20 - 1
test/utilities/function.objects/func.wrap/func.wrap.badcall/func.wrap.badcall.const/bad_function_call_ctor.pass.cpp

@@ -1 +1,20 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// Class bad_function_call

// bad_function_call();

#include <functional>
#include <type_traits>

int main()
{
    std::bad_function_call ex;
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// Class bad_function_call
+
+// bad_function_call();
+
+#include <functional>
+#include <type_traits>
+
+int main()
+{
+    std::bad_function_call ex;
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.alg/swap.pass.cpp


+ 29 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp

@@ -1 +1,29 @@
-//===----------------------------------------------------------------------===//
//
//                     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 operator bool() const

#include <functional>
#include <cassert>

int g(int) {return 0;}

int main()
{
    {
    std::function<int(int)> f;
    assert(!f);
    f = g;
    assert(f);
    }
}
+//===----------------------------------------------------------------------===//
+//
+//                     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 operator bool() const
+
+#include <functional>
+#include <cassert>
+
+int g(int) {return 0;}
+
+int main()
+{
+    {
+    std::function<int(int)> f;
+    assert(!f);
+    f = g;
+    assert(f);
+    }
+}

+ 98 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F.pass.cpp

@@ -1 +1,98 @@
-//===----------------------------------------------------------------------===//
//
//                     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);
    }
}
+//===----------------------------------------------------------------------===//
+//
+//                     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);
+    }
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp


+ 1 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/alloc_rfunction.pass.cpp

@@ -77,5 +77,5 @@ int main()
     assert(f.target<A>() == 0);
     assert(f.target<A>() == 0);
     assert(f.target<int(*)(int)>() == 0);
     assert(f.target<int(*)(int)>() == 0);
     }
     }
-#endif
+#endif  // _LIBCPP_MOVE
 }
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy.pass.cpp


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_assign.pass.cpp


+ 23 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/default.pass.cpp

@@ -1 +1,23 @@
-//===----------------------------------------------------------------------===//
//
//                     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);
}
+//===----------------------------------------------------------------------===//
+//
+//                     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);
+}

+ 23 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t.pass.cpp

@@ -1 +1,23 @@
-//===----------------------------------------------------------------------===//
//
//                     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);
}
+//===----------------------------------------------------------------------===//
+//
+//                     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);
+}

+ 86 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/nullptr_t_assign.pass.cpp

@@ -1 +1,86 @@
-//===----------------------------------------------------------------------===//
//
//                     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);
    }
}
+//===----------------------------------------------------------------------===//
+//
+//                     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);
+    }
+}

+ 46 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp

@@ -1 +1,46 @@
-//===----------------------------------------------------------------------===//
//
//                     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...)>

// R operator()(ArgTypes... args) const

#include <functional>
#include <cassert>

// member data pointer:  cv qualifiers should transfer from argument to return type

struct A_int_1
{
    A_int_1() : data_(5) {}

    int data_;
};

void
test_int_1()
{
    // member data pointer
    {
    int A_int_1::*fp = &A_int_1::data_;
    A_int_1 a;
    std::function<int& (const A_int_1*)> r2(fp);
    const A_int_1* ap = &a;
    assert(r2(ap) == 6);
    r2(ap) = 7;
    assert(r2(ap) == 7);
    }
}


int main()
{
    test_int_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...)>
+
+// R operator()(ArgTypes... args) const
+
+#include <functional>
+#include <cassert>
+
+// member data pointer:  cv qualifiers should transfer from argument to return type
+
+struct A_int_1
+{
+    A_int_1() : data_(5) {}
+
+    int data_;
+};
+
+void
+test_int_1()
+{
+    // member data pointer
+    {
+    int A_int_1::*fp = &A_int_1::data_;
+    A_int_1 a;
+    std::function<int& (const A_int_1*)> r2(fp);
+    const A_int_1* ap = &a;
+    assert(r2(ap) == 6);
+    r2(ap) = 7;
+    assert(r2(ap) == 7);
+    }
+}
+
+int main()
+{
+    test_int_1();
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp


+ 58 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_int_0.pass.cpp

@@ -1 +1,58 @@
-//===----------------------------------------------------------------------===//
//
//                     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...)>

// R operator()(ArgTypes... args) const

#include <functional>
#include <cassert>

// 0 args, return int

int count = 0;

int f_int_0()
{
    return 3;
}

struct A_int_0
{
    int operator()() {return 4;}
};

void
test_int_0()
{
    // function
    {
    std::function<int ()> r1(f_int_0);
    assert(r1() == 3);
    }
    // function pointer
    {
    int (*fp)() = f_int_0;
    std::function<int ()> r1(fp);
    assert(r1() == 3);
    }
    // functor
    {
    A_int_0 a0;
    std::function<int ()> r1(a0);
    assert(r1() == 4);
    }
}

int main()
{
    test_int_0();
}
+//===----------------------------------------------------------------------===//
+//
+//                     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...)>
+
+// R operator()(ArgTypes... args) const
+
+#include <functional>
+#include <cassert>
+
+// 0 args, return int
+
+int count = 0;
+
+int f_int_0()
+{
+    return 3;
+}
+
+struct A_int_0
+{
+    int operator()() {return 4;}
+};
+
+void
+test_int_0()
+{
+    // function
+    {
+    std::function<int ()> r1(f_int_0);
+    assert(r1() == 3);
+    }
+    // function pointer
+    {
+    int (*fp)() = f_int_0;
+    std::function<int ()> r1(fp);
+    assert(r1() == 3);
+    }
+    // functor
+    {
+    A_int_0 a0;
+    std::function<int ()> r1(a0);
+    assert(r1() == 4);
+    }
+}
+
+int main()
+{
+    test_int_0();
+}

+ 67 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke_void_0.pass.cpp

@@ -1 +1,67 @@
-//===----------------------------------------------------------------------===//
//
//                     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...)>

// R operator()(ArgTypes... args) const

#include <functional>
#include <new>
#include <cstdlib>
#include <cassert>

// 0 args, return void

int count = 0;

void f_void_0()
{
    ++count;
}

struct A_void_0
{
    void operator()() {++count;}
};

void
test_void_0()
{
    int save_count = count;
    // function
    {
    std::function<void ()> r1(f_void_0);
    r1();
    assert(count == save_count+1);
    save_count = count;
    }
    // function pointer
    {
    void (*fp)() = f_void_0;
    std::function<void ()> r1(fp);
    r1();
    assert(count == save_count+1);
    save_count = count;
    }
    // functor
    {
    A_void_0 a0;
    std::function<void ()> r1(a0);
    r1();
    assert(count == save_count+1);
    save_count = count;
    }
}

int main()
{
    test_void_0();
}
+//===----------------------------------------------------------------------===//
+//
+//                     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...)>
+
+// R operator()(ArgTypes... args) const
+
+#include <functional>
+#include <new>
+#include <cstdlib>
+#include <cassert>
+
+// 0 args, return void
+
+int count = 0;
+
+void f_void_0()
+{
+    ++count;
+}
+
+struct A_void_0
+{
+    void operator()() {++count;}
+};
+
+void
+test_void_0()
+{
+    int save_count = count;
+    // function
+    {
+    std::function<void ()> r1(f_void_0);
+    r1();
+    assert(count == save_count+1);
+    save_count = count;
+    }
+    // function pointer
+    {
+    void (*fp)() = f_void_0;
+    std::function<void ()> r1(fp);
+    r1();
+    assert(count == save_count+1);
+    save_count = count;
+    }
+    // functor
+    {
+    A_void_0 a0;
+    std::function<void ()> r1(a0);
+    r1();
+    assert(count == save_count+1);
+    save_count = count;
+    }
+}
+
+int main()
+{
+    test_void_0();
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.mod/swap.pass.cpp


+ 41 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.nullptr/operator_==.pass.cpp

@@ -1 +1,41 @@
-//===----------------------------------------------------------------------===//
//
//                     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 <MoveConstructible R, MoveConstructible ... ArgTypes> 
//   bool operator==(const function<R(ArgTypes...)>&, nullptr_t); 
// 
// template <MoveConstructible R, MoveConstructible ... ArgTypes> 
//   bool operator==(nullptr_t, const function<R(ArgTypes...)>&); 
// 
// template <MoveConstructible R, MoveConstructible ... ArgTypes> 
//   bool operator!=(const function<R(ArgTypes...)>&, nullptr_t); 
// 
// template <MoveConstructible  R, MoveConstructible ... ArgTypes> 
//   bool operator!=(nullptr_t, const function<R(ArgTypes...)>&); 

#include <functional>
#include <cassert>

int g(int) {return 0;}

int main()
{
    {
    std::function<int(int)> f;
    assert(f == nullptr);
    assert(nullptr == f);
    f = g;
    assert(f != nullptr);
    assert(nullptr != f);
    }
}
+//===----------------------------------------------------------------------===//
+//
+//                     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 <MoveConstructible R, MoveConstructible ... ArgTypes>
+//   bool operator==(const function<R(ArgTypes...)>&, nullptr_t);
+//
+// template <MoveConstructible R, MoveConstructible ... ArgTypes>
+//   bool operator==(nullptr_t, const function<R(ArgTypes...)>&);
+//
+// template <MoveConstructible R, MoveConstructible ... ArgTypes>
+//   bool operator!=(const function<R(ArgTypes...)>&, nullptr_t);
+//
+// template <MoveConstructible  R, MoveConstructible ... ArgTypes>
+//   bool operator!=(nullptr_t, const function<R(ArgTypes...)>&);
+
+#include <functional>
+#include <cassert>
+
+int g(int) {return 0;}
+
+int main()
+{
+    {
+    std::function<int(int)> f;
+    assert(f == nullptr);
+    assert(nullptr == f);
+    f = g;
+    assert(f != nullptr);
+    assert(nullptr != f);
+    }
+}

+ 89 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp

@@ -1 +1,89 @@
-//===----------------------------------------------------------------------===//
//
//                     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<typename T> 
//   requires Callable<T, ArgTypes...> && Convertible<Callable<T, ArgTypes...>::result_type, R> 
//   T*
//   target(); 
// template<typename T> 
//   requires Callable<T, ArgTypes...> && Convertible<Callable<T, ArgTypes...>::result_type, R> 
//   const T*
//   target() const;

#include <functional>
#include <new>
#include <cstdlib>
#include <cassert>

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()
{
    {
    std::function<int(int)> f = A();
    assert(A::count == 1);
    assert(f.target<A>());
    assert(f.target<int(*)(int)>() == 0);
    }
    assert(A::count == 0);
    {
    std::function<int(int)> f = g;
    assert(A::count == 0);
    assert(f.target<int(*)(int)>());
    assert(f.target<A>() == 0);
    }
    assert(A::count == 0);
    {
    const std::function<int(int)> f = A();
    assert(A::count == 1);
    assert(f.target<A>());
    assert(f.target<int(*)(int)>() == 0);
    }
    assert(A::count == 0);
    {
    const std::function<int(int)> f = g;
    assert(A::count == 0);
    assert(f.target<int(*)(int)>());
    assert(f.target<A>() == 0);
    }
    assert(A::count == 0);
}
+//===----------------------------------------------------------------------===//
+//
+//                     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<typename T>
+//   requires Callable<T, ArgTypes...> && Convertible<Callable<T, ArgTypes...>::result_type, R>
+//   T*
+//   target();
+// template<typename T>
+//   requires Callable<T, ArgTypes...> && Convertible<Callable<T, ArgTypes...>::result_type, R>
+//   const T*
+//   target() const;
+
+#include <functional>
+#include <new>
+#include <cstdlib>
+#include <cassert>
+
+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()
+{
+    {
+    std::function<int(int)> f = A();
+    assert(A::count == 1);
+    assert(f.target<A>());
+    assert(f.target<int(*)(int)>() == 0);
+    }
+    assert(A::count == 0);
+    {
+    std::function<int(int)> f = g;
+    assert(A::count == 0);
+    assert(f.target<int(*)(int)>());
+    assert(f.target<A>() == 0);
+    }
+    assert(A::count == 0);
+    {
+    const std::function<int(int)> f = A();
+    assert(A::count == 1);
+    assert(f.target<A>());
+    assert(f.target<int(*)(int)>() == 0);
+    }
+    assert(A::count == 0);
+    {
+    const std::function<int(int)> f = g;
+    assert(A::count == 0);
+    assert(f.target<int(*)(int)>());
+    assert(f.target<A>() == 0);
+    }
+    assert(A::count == 0);
+}

+ 61 - 1
test/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target_type.pass.cpp

@@ -1 +1,61 @@
-//===----------------------------------------------------------------------===//
//
//                     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...)>

// const std::type_info& target_type() const;

#include <functional>
#include <typeinfo>
#include <cassert>

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()
{
    {
    std::function<int(int)> f = A();
    assert(f.target_type() == typeid(A));
    }
    {
    std::function<int(int)> f;
    assert(f.target_type() == typeid(void));
    }
}
+//===----------------------------------------------------------------------===//
+//
+//                     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...)>
+
+// const std::type_info& target_type() const;
+
+#include <functional>
+#include <typeinfo>
+#include <cassert>
+
+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()
+{
+    {
+    std::function<int(int)> f = A();
+    assert(f.target_type() == typeid(A));
+    }
+    {
+    std::function<int(int)> f;
+    assert(f.target_type() == typeid(void));
+    }
+}

+ 3 - 3
test/utilities/function.objects/func.wrap/func.wrap.func/test_allocator.h

@@ -62,7 +62,7 @@ public:
 #ifdef _LIBCPP_MOVE
 #ifdef _LIBCPP_MOVE
     void construct(pointer p, T&& val)
     void construct(pointer p, T&& val)
         {::new(p) T(std::move(val));}
         {::new(p) T(std::move(val));}
-#endif
+#endif  // _LIBCPP_MOVE
     void destroy(pointer p) {p->~T();}
     void destroy(pointer p) {p->~T();}
 
 
     friend bool operator==(const test_allocator& x, const test_allocator& y)
     friend bool operator==(const test_allocator& x, const test_allocator& y)
@@ -105,8 +105,8 @@ public:
 #ifdef _LIBCPP_HAS_NO_ADVANCED_SFINAE
 #ifdef _LIBCPP_HAS_NO_ADVANCED_SFINAE
     std::size_t max_size() const
     std::size_t max_size() const
         {return UINT_MAX / sizeof(T);}
         {return UINT_MAX / sizeof(T);}
-#endif
+#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
 
 
 };
 };
 
 
-#endif
+#endif  // TEST_ALLOCATOR_H

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/func.wrap/func.wrap.func/types.pass.cpp


+ 12 - 1
test/utilities/function.objects/func.wrap/nothing_to_do.pass.cpp

@@ -1 +1,12 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

int main()
{
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int main()
+{
+}

+ 26 - 1
test/utilities/function.objects/function.pointer.adaptors/pointer_to_binary_function.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// pointer_to_binary_function

#include <functional>
#include <type_traits>
#include <cassert>

double binary_f(int i, short j) {return i - j + .75;}

int main()
{
    typedef std::pointer_to_binary_function<int, short, double> F;
    static_assert((std::is_base_of<std::binary_function<int, short, double>, F>::value), "");
    const F f(binary_f);
    assert(f(36, 27) == 9.75);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// pointer_to_binary_function
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double binary_f(int i, short j) {return i - j + .75;}
+
+int main()
+{
+    typedef std::pointer_to_binary_function<int, short, double> F;
+    static_assert((std::is_base_of<std::binary_function<int, short, double>, F>::value), "");
+    const F f(binary_f);
+    assert(f(36, 27) == 9.75);
+}

+ 26 - 1
test/utilities/function.objects/function.pointer.adaptors/pointer_to_unary_function.pass.cpp

@@ -1 +1,26 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// pointer_to_unary_function

#include <functional>
#include <type_traits>
#include <cassert>

double unary_f(int i) {return 0.5 - i;}

int main()
{
    typedef std::pointer_to_unary_function<int, double> F;
    static_assert((std::is_base_of<std::unary_function<int, double>, F>::value), "");
    const F f(unary_f);
    assert(f(36) == -35.5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// pointer_to_unary_function
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double unary_f(int i) {return 0.5 - i;}
+
+int main()
+{
+    typedef std::pointer_to_unary_function<int, double> F;
+    static_assert((std::is_base_of<std::unary_function<int, double>, F>::value), "");
+    const F f(unary_f);
+    assert(f(36) == -35.5);
+}

+ 25 - 1
test/utilities/function.objects/function.pointer.adaptors/ptr_fun1.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template <CopyConstructible Arg, Returnable Result> 
// pointer_to_unary_function<Arg, Result>
// ptr_fun(Result (*f)(Arg));

#include <functional>
#include <type_traits>
#include <cassert>

double unary_f(int i) {return 0.5 - i;}

int main()
{
    assert(std::ptr_fun(unary_f)(36) == -35.5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <CopyConstructible Arg, Returnable Result>
+// pointer_to_unary_function<Arg, Result>
+// ptr_fun(Result (*f)(Arg));
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double unary_f(int i) {return 0.5 - i;}
+
+int main()
+{
+    assert(std::ptr_fun(unary_f)(36) == -35.5);
+}

+ 25 - 1
test/utilities/function.objects/function.pointer.adaptors/ptr_fun2.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template <CopyConstructible Arg1, CopyConstructible Arg2, Returnable Result> 
// pointer_to_binary_function<Arg1,Arg2,Result> 
// ptr_fun(Result (*f)(Arg1, Arg2));

#include <functional>
#include <type_traits>
#include <cassert>

double binary_f(int i, short j) {return i - j + .75;}

int main()
{
    assert(std::ptr_fun(binary_f)(36, 27) == 9.75);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template <CopyConstructible Arg1, CopyConstructible Arg2, Returnable Result>
+// pointer_to_binary_function<Arg1,Arg2,Result>
+// ptr_fun(Result (*f)(Arg1, Arg2));
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+double binary_f(int i, short j) {return i - j + .75;}
+
+int main()
+{
+    assert(std::ptr_fun(binary_f)(36, 27) == 9.75);
+}

+ 27 - 1
test/utilities/function.objects/logical.operations/logical_and.pass.cpp

@@ -1 +1,27 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// logical_and

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::logical_and<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(f(36, 36));
    assert(!f(36, 0));
    assert(!f(0, 36));
    assert(!f(0, 0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// logical_and
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::logical_and<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(f(36, 36));
+    assert(!f(36, 0));
+    assert(!f(0, 36));
+    assert(!f(0, 0));
+}

+ 25 - 1
test/utilities/function.objects/logical.operations/logical_not.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// logical_not

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::logical_not<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::unary_function<int, bool>, F>::value), "");
    assert(!f(36));
    assert(f(0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// logical_not
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::logical_not<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::unary_function<int, bool>, F>::value), "");
+    assert(!f(36));
+    assert(f(0));
+}

+ 27 - 1
test/utilities/function.objects/logical.operations/logical_or.pass.cpp

@@ -1 +1,27 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// logical_or

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::logical_or<int> F;
    const F f = F();
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(f(36, 36));
    assert(f(36, 0));
    assert(f(0, 36));
    assert(!f(0, 0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// logical_or
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::logical_or<int> F;
+    const F f = F();
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(f(36, 36));
+    assert(f(36, 0));
+    assert(f(0, 36));
+    assert(!f(0, 0));
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<cReturnable S, ClassType T>
//   const_mem_fun_t<S,T> 
//   mem_fun(S (T::*f)() const);

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    const A a = A();
    assert(std::mem_fun(&A::a3)(&a) == 1);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<cReturnable S, ClassType T>
+//   const_mem_fun_t<S,T>
+//   mem_fun(S (T::*f)() const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun(&A::a3)(&a) == 1);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T, CopyConstructible A>
//   const_mem_fun1_t<S,T,A> 
//   mem_fun(S (T::*f)(A) const);

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    const A a = A();
    assert(std::mem_fun(&A::a4)(&a, 6) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   const_mem_fun1_t<S,T,A>
+//   mem_fun(S (T::*f)(A) const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun(&A::a4)(&a, 6) == 5);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// const_mem_fun1_ref_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::const_mem_fun1_ref_t<double, A, unsigned> F;
    static_assert((std::is_base_of<std::binary_function<A, unsigned, double>, F>::value), "");
    const F f(&A::a4);
    const A a = A();
    assert(f(a, 6) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun1_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun1_ref_t<double, A, unsigned> F;
+    static_assert((std::is_base_of<std::binary_function<A, unsigned, double>, F>::value), "");
+    const F f(&A::a4);
+    const A a = A();
+    assert(f(a, 6) == 5);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun1_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// const_mem_fun1_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::const_mem_fun1_t<double, A, unsigned> F;
    static_assert((std::is_base_of<std::binary_function<const A*, unsigned, double>, F>::value), "");
    const F f(&A::a4);
    const A a = A();
    assert(f(&a, 6) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun1_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun1_t<double, A, unsigned> F;
+    static_assert((std::is_base_of<std::binary_function<const A*, unsigned, double>, F>::value), "");
+    const F f(&A::a4);
+    const A a = A();
+    assert(f(&a, 6) == 5);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T>
//   const_mem_fun_ref_t<S,T> 
//   mem_fun_ref(S (T::*f)() const);

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    const A a = A();
    assert(std::mem_fun_ref(&A::a3)(a) == 1);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T>
+//   const_mem_fun_ref_t<S,T>
+//   mem_fun_ref(S (T::*f)() const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun_ref(&A::a3)(a) == 1);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref1.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T, CopyConstructible A>
//   const_mem_fun1_ref_t<S,T,A> 
//   mem_fun_ref(S (T::*f)(A) const);

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    const A a = A();
    assert(std::mem_fun_ref(&A::a4)(a, 6) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   const_mem_fun1_ref_t<S,T,A>
+//   mem_fun_ref(S (T::*f)(A) const);
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    const A a = A();
+    assert(std::mem_fun_ref(&A::a4)(a, 6) == 5);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// const_mem_fun_ref_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::const_mem_fun_ref_t<int, A> F;
    static_assert((std::is_base_of<std::unary_function<A, int>, F>::value), "");
    const F f(&A::a3);
    const A a = A();
    assert(f(a) == 1);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun_ref_t<int, A> F;
+    static_assert((std::is_base_of<std::unary_function<A, int>, F>::value), "");
+    const F f(&A::a3);
+    const A a = A();
+    assert(f(a) == 1);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/const_mem_fun_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// const_mem_fun_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::const_mem_fun_t<int, A> F;
    static_assert((std::is_base_of<std::unary_function<const A*, int>, F>::value), "");
    const F f(&A::a3);
    const A a = A();
    assert(f(&a) == 1);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// const_mem_fun_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::const_mem_fun_t<int, A> F;
+    static_assert((std::is_base_of<std::unary_function<const A*, int>, F>::value), "");
+    const F f(&A::a3);
+    const A a = A();
+    assert(f(&a) == 1);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T>
//   mem_fun_t<S,T> 
//   mem_fun(S (T::*f)());

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    A a;
    assert(std::mem_fun(&A::a1)(&a) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T>
+//   mem_fun_t<S,T>
+//   mem_fun(S (T::*f)());
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun(&A::a1)(&a) == 5);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun1.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T, CopyConstructible A>
//   mem_fun1_t<S,T,A> 
//   mem_fun(S (T::*f)(A));

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    A a;
    assert(std::mem_fun(&A::a2)(&a, 5) == 6);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   mem_fun1_t<S,T,A>
+//   mem_fun(S (T::*f)(A));
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun(&A::a2)(&a, 5) == 6);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun1_ref_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// mem_fun1_ref_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::mem_fun1_ref_t<short, A, int> F;
    static_assert((std::is_base_of<std::binary_function<A, int, short>, F>::value), "");
    const F f(&A::a2);
    A a;
    assert(f(a, 5) == 6);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun1_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun1_ref_t<short, A, int> F;
+    static_assert((std::is_base_of<std::binary_function<A, int, short>, F>::value), "");
+    const F f(&A::a2);
+    A a;
+    assert(f(a, 5) == 6);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun1_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// mem_fun1_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::mem_fun1_t<short, A, int> F;
    static_assert((std::is_base_of<std::binary_function<A*, int, short>, F>::value), "");
    const F f(&A::a2);
    A a;
    assert(f(&a, 5) == 6);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun1_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun1_t<short, A, int> F;
+    static_assert((std::is_base_of<std::binary_function<A*, int, short>, F>::value), "");
+    const F f(&A::a2);
+    A a;
+    assert(f(&a, 5) == 6);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T>
//   mem_fun_ref_t<S,T> 
//   mem_fun_ref(S (T::*f)());

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    A a;
    assert(std::mem_fun_ref(&A::a1)(a) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T>
+//   mem_fun_ref_t<S,T>
+//   mem_fun_ref(S (T::*f)());
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun_ref(&A::a1)(a) == 5);
+}

+ 31 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref1.pass.cpp

@@ -1 +1,31 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// template<Returnable S, ClassType T, CopyConstructible A>
//   mem_fun1_ref_t<S,T,A> 
//   mem_fun_ref(S (T::*f)(A));

#include <functional>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    A a;
    assert(std::mem_fun_ref(&A::a2)(a, 5) == 6);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<Returnable S, ClassType T, CopyConstructible A>
+//   mem_fun1_ref_t<S,T,A>
+//   mem_fun_ref(S (T::*f)(A));
+
+#include <functional>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    A a;
+    assert(std::mem_fun_ref(&A::a2)(a, 5) == 6);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun_ref_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// mem_fun_ref_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::mem_fun_ref_t<char, A> F;
    static_assert((std::is_base_of<std::unary_function<A, char>, F>::value), "");
    const F f(&A::a1);
    A a;
    assert(f(a) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun_ref_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun_ref_t<char, A> F;
+    static_assert((std::is_base_of<std::unary_function<A, char>, F>::value), "");
+    const F f(&A::a1);
+    A a;
+    assert(f(a) == 5);
+}

+ 33 - 1
test/utilities/function.objects/member.pointer.adaptors/mem_fun_t.pass.cpp

@@ -1 +1,33 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// mem_fun_t

#include <functional>
#include <type_traits>
#include <cassert>

struct A
{
    char a1() {return 5;}
    short a2(int i) {return short(i+1);}
    int a3() const {return 1;}
    double a4(unsigned i) const {return i-1;}
};

int main()
{
    typedef std::mem_fun_t<char, A> F;
    static_assert((std::is_base_of<std::unary_function<A*, char>, F>::value), "");
    const F f(&A::a1);
    A a;
    assert(f(&a) == 5);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// mem_fun_t
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+struct A
+{
+    char a1() {return 5;}
+    short a2(int i) {return short(i+1);}
+    int a3() const {return 1;}
+    double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+    typedef std::mem_fun_t<char, A> F;
+    static_assert((std::is_base_of<std::unary_function<A*, char>, F>::value), "");
+    const F f(&A::a1);
+    A a;
+    assert(f(&a) == 5);
+}

+ 27 - 1
test/utilities/function.objects/negators/binary_negate.pass.cpp

@@ -1 +1,27 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// binary_negate

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::binary_negate<std::logical_and<int> > F;
    const F f = F(std::logical_and<int>());
    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
    assert(!f(36, 36));
    assert( f(36, 0));
    assert( f(0, 36));
    assert( f(0, 0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// binary_negate
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::binary_negate<std::logical_and<int> > F;
+    const F f = F(std::logical_and<int>());
+    static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), "");
+    assert(!f(36, 36));
+    assert( f(36, 0));
+    assert( f(0, 36));
+    assert( f(0, 0));
+}

+ 22 - 1
test/utilities/function.objects/negators/not1.pass.cpp

@@ -1 +1,22 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// not1

#include <functional>
#include <cassert>

int main()
{
    typedef std::logical_not<int> F;
    assert(std::not1(F())(36));
    assert(!std::not1(F())(0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// not1
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    typedef std::logical_not<int> F;
+    assert(std::not1(F())(36));
+    assert(!std::not1(F())(0));
+}

+ 24 - 1
test/utilities/function.objects/negators/not2.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// not2

#include <functional>
#include <cassert>

int main()
{
    typedef std::logical_and<int> F;
    assert(!std::not2(F())(36, 36));
    assert( std::not2(F())(36, 0));
    assert( std::not2(F())(0, 36));
    assert( std::not2(F())(0, 0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// not2
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    typedef std::logical_and<int> F;
+    assert(!std::not2(F())(36, 36));
+    assert( std::not2(F())(36, 0));
+    assert( std::not2(F())(0, 36));
+    assert( std::not2(F())(0, 0));
+}

+ 25 - 1
test/utilities/function.objects/negators/unary_negate.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// unary_negate

#include <functional>
#include <type_traits>
#include <cassert>

int main()
{
    typedef std::unary_negate<std::logical_not<int> > F;
    const F f = F(std::logical_not<int>());
    static_assert((std::is_base_of<std::unary_function<int, bool>, F>::value), "");
    assert(f(36));
    assert(!f(0));
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// unary_negate
+
+#include <functional>
+#include <type_traits>
+#include <cassert>
+
+int main()
+{
+    typedef std::unary_negate<std::logical_not<int> > F;
+    const F f = F(std::logical_not<int>());
+    static_assert((std::is_base_of<std::unary_function<int, bool>, F>::value), "");
+    assert(f(36));
+    assert(!f(0));
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/refwrap/binary.pass.cpp


+ 46 - 1
test/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp

@@ -1 +1,46 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// operator T& () const;

#include <functional>
#include <cassert>

class functor1
    : public std::unary_function<int, char>
{
};

template <class T>
void
test(T& t)
{
    std::reference_wrapper<T> r(t);
    T& r2 = r;
    assert(&r2 == &t);
}

void f() {}

int main()
{
    void (*fp)() = f;
    test(fp);
    test(f);
    functor1 f1;
    test(f1);
    int i = 0;
    test(i);
    const int j = 0;
    test(j);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// operator T& () const;
+
+#include <functional>
+#include <cassert>
+
+class functor1
+    : public std::unary_function<int, char>
+{
+};
+
+template <class T>
+void
+test(T& t)
+{
+    std::reference_wrapper<T> r(t);
+    T& r2 = r;
+    assert(&r2 == &t);
+}
+
+void f() {}
+
+int main()
+{
+    void (*fp)() = f;
+    test(fp);
+    test(f);
+    functor1 f1;
+    test(f1);
+    int i = 0;
+    test(i);
+    const int j = 0;
+    test(j);
+}

+ 58 - 1
test/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp

@@ -1 +1,58 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// reference_wrapper& operator=(const reference_wrapper<T>& x);

#include <functional>
#include <cassert>

class functor1
    : public std::unary_function<int, char>
{
};

template <class T>
void
test(T& t)
{
    std::reference_wrapper<T> r(t);
    T t2 = t;
    std::reference_wrapper<T> r2(t2);
    r2 = r;
    assert(&r2.get() == &t);
}

void f() {}
void g() {}

void
test_function()
{
    std::reference_wrapper<void ()> r(f);
    std::reference_wrapper<void ()> r2(g);
    r2 = r;
    assert(&r2.get() == &f);
}

int main()
{
    void (*fp)() = f;
    test(fp);
    test_function();
    functor1 f1;
    test(f1);
    int i = 0;
    test(i);
    const int j = 0;
    test(j);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// reference_wrapper& operator=(const reference_wrapper<T>& x);
+
+#include <functional>
+#include <cassert>
+
+class functor1
+    : public std::unary_function<int, char>
+{
+};
+
+template <class T>
+void
+test(T& t)
+{
+    std::reference_wrapper<T> r(t);
+    T t2 = t;
+    std::reference_wrapper<T> r2(t2);
+    r2 = r;
+    assert(&r2.get() == &t);
+}
+
+void f() {}
+void g() {}
+
+void
+test_function()
+{
+    std::reference_wrapper<void ()> r(f);
+    std::reference_wrapper<void ()> r2(g);
+    r2 = r;
+    assert(&r2.get() == &f);
+}
+
+int main()
+{
+    void (*fp)() = f;
+    test(fp);
+    test_function();
+    functor1 f1;
+    test(f1);
+    int i = 0;
+    test(i);
+    const int j = 0;
+    test(j);
+}

+ 46 - 1
test/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp

@@ -1 +1,46 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// reference_wrapper(const reference_wrapper<T>& x);

#include <functional>
#include <cassert>

class functor1
    : public std::unary_function<int, char>
{
};

template <class T>
void
test(T& t)
{
    std::reference_wrapper<T> r(t);
    std::reference_wrapper<T> r2 = r;
    assert(&r2.get() == &t);
}

void f() {}

int main()
{
    void (*fp)() = f;
    test(fp);
    test(f);
    functor1 f1;
    test(f1);
    int i = 0;
    test(i);
    const int j = 0;
    test(j);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// reference_wrapper(const reference_wrapper<T>& x);
+
+#include <functional>
+#include <cassert>
+
+class functor1
+    : public std::unary_function<int, char>
+{
+};
+
+template <class T>
+void
+test(T& t)
+{
+    std::reference_wrapper<T> r(t);
+    std::reference_wrapper<T> r2 = r;
+    assert(&r2.get() == &t);
+}
+
+void f() {}
+
+int main()
+{
+    void (*fp)() = f;
+    test(fp);
+    test(f);
+    functor1 f1;
+    test(f1);
+    int i = 0;
+    test(i);
+    const int j = 0;
+    test(j);
+}

+ 22 - 1
test/utilities/function.objects/refwrap/refwrap.const/type_ctor.fail.cpp

@@ -1 +1,22 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// reference_wrapper(T&&) = delete;

#include <functional>
#include <cassert>

int main()
{
    std::reference_wrapper<const int> r(3);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// reference_wrapper(T&&) = delete;
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    std::reference_wrapper<const int> r(3);
+}

+ 45 - 1
test/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp

@@ -1 +1,45 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// reference_wrapper(T& t);

#include <functional>
#include <cassert>

class functor1
    : public std::unary_function<int, char>
{
};

template <class T>
void
test(T& t)
{
    std::reference_wrapper<T> r(t);
    assert(&r.get() == &t);
}

void f() {}

int main()
{
    void (*fp)() = f;
    test(fp);
    test(f);
    functor1 f1;
    test(f1);
    int i = 0;
    test(i);
    const int j = 0;
    test(j);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// reference_wrapper(T& t);
+
+#include <functional>
+#include <cassert>
+
+class functor1
+    : public std::unary_function<int, char>
+{
+};
+
+template <class T>
+void
+test(T& t)
+{
+    std::reference_wrapper<T> r(t);
+    assert(&r.get() == &t);
+}
+
+void f() {}
+
+int main()
+{
+    void (*fp)() = f;
+    test(fp);
+    test(f);
+    functor1 f1;
+    test(f1);
+    int i = 0;
+    test(i);
+    const int j = 0;
+    test(j);
+}

+ 24 - 1
test/utilities/function.objects/refwrap/refwrap.helpers/cref_1.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <ObjectType T> reference_wrapper<const T> cref(const T& t);

#include <functional>
#include <cassert>

int main()
{
    int i = 0;
    std::reference_wrapper<const int> r = std::cref(i);
    assert(&r.get() == &i);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <ObjectType T> reference_wrapper<const T> cref(const T& t);
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    int i = 0;
+    std::reference_wrapper<const int> r = std::cref(i);
+    assert(&r.get() == &i);
+}

+ 25 - 1
test/utilities/function.objects/refwrap/refwrap.helpers/cref_2.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <ObjectType T> reference_wrapper<const T> cref(reference_wrapper<T> t);

#include <functional>
#include <cassert>

int main()
{
    const int i = 0;
    std::reference_wrapper<const int> r1 = std::cref(i);
    std::reference_wrapper<const int> r2 = std::cref(r1);
    assert(&r2.get() == &i);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <ObjectType T> reference_wrapper<const T> cref(reference_wrapper<T> t);
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    const int i = 0;
+    std::reference_wrapper<const int> r1 = std::cref(i);
+    std::reference_wrapper<const int> r2 = std::cref(r1);
+    assert(&r2.get() == &i);
+}

+ 27 - 1
test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.fail.cpp

@@ -1 +1,27 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <ObjectType T> reference_wrapper<T> ref(T& t);

// Don't allow binding to a temp

#include <functional>

struct A {};

const A source() {return A();}

int main()
{
    std::reference_wrapper<const A> r = std::ref(source());
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <ObjectType T> reference_wrapper<T> ref(T& t);
+
+// Don't allow binding to a temp
+
+#include <functional>
+
+struct A {};
+
+const A source() {return A();}
+
+int main()
+{
+    std::reference_wrapper<const A> r = std::ref(source());
+}

+ 24 - 1
test/utilities/function.objects/refwrap/refwrap.helpers/ref_1.pass.cpp

@@ -1 +1,24 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <ObjectType T> reference_wrapper<T> ref(T& t);

#include <functional>
#include <cassert>

int main()
{
    int i = 0;
    std::reference_wrapper<int> r = std::ref(i);
    assert(&r.get() == &i);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <ObjectType T> reference_wrapper<T> ref(T& t);
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    int i = 0;
+    std::reference_wrapper<int> r = std::ref(i);
+    assert(&r.get() == &i);
+}

+ 25 - 1
test/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp

@@ -1 +1,25 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <ObjectType T> reference_wrapper<T> ref(reference_wrapper<T>t);

#include <functional>
#include <cassert>

int main()
{
    int i = 0;
    std::reference_wrapper<int> r1 = std::ref(i);
    std::reference_wrapper<int> r2 = std::ref(r1);
    assert(&r2.get() == &i);
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <ObjectType T> reference_wrapper<T> ref(reference_wrapper<T>t);
+
+#include <functional>
+#include <cassert>
+
+int main()
+{
+    int i = 0;
+    std::reference_wrapper<int> r1 = std::ref(i);
+    std::reference_wrapper<int> r2 = std::ref(r1);
+    assert(&r2.get() == &i);
+}

+ 52 - 1
test/utilities/function.objects/refwrap/refwrap.invoke/invoke.fail.cpp

@@ -1 +1,52 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <class... ArgTypes> 
//   requires Callable<T, ArgTypes&&...> 
//   Callable<T, ArgTypes&&...>::result_type 
//   operator()(ArgTypes&&... args) const;

#include <functional>
#include <cassert>

// member data pointer:  cv qualifiers should transfer from argument to return type

struct A_int_1
{
    A_int_1() : data_(5) {}

    int data_;
};

void
test_int_1()
{
    // member data pointer
    {
    int A_int_1::*fp = &A_int_1::data_;
    std::reference_wrapper<int A_int_1::*> r1(fp);
    A_int_1 a;
    assert(r1(a) == 5);
    r1(a) = 6;
    assert(r1(a) == 6);
    const A_int_1* ap = &a;
    assert(r1(ap) == 6);
    r1(ap) = 7;
    assert(r1(ap) == 7);
    }
}


int main()
{
    test_int_1();
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <class... ArgTypes>
+//   requires Callable<T, ArgTypes&&...>
+//   Callable<T, ArgTypes&&...>::result_type
+//   operator()(ArgTypes&&... args) const;
+
+#include <functional>
+#include <cassert>
+
+// member data pointer:  cv qualifiers should transfer from argument to return type
+
+struct A_int_1
+{
+    A_int_1() : data_(5) {}
+
+    int data_;
+};
+
+void
+test_int_1()
+{
+    // member data pointer
+    {
+    int A_int_1::*fp = &A_int_1::data_;
+    std::reference_wrapper<int A_int_1::*> r1(fp);
+    A_int_1 a;
+    assert(r1(a) == 5);
+    r1(a) = 6;
+    assert(r1(a) == 6);
+    const A_int_1* ap = &a;
+    assert(r1(ap) == 6);
+    r1(ap) = 7;
+    assert(r1(ap) == 7);
+    }
+}
+
+int main()
+{
+    test_int_1();
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
test/utilities/function.objects/refwrap/refwrap.invoke/invoke.pass.cpp


+ 76 - 1
test/utilities/function.objects/refwrap/refwrap.invoke/invoke_int_0.pass.cpp

@@ -1 +1,76 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <class... ArgTypes> 
//   requires Callable<T, ArgTypes&&...> 
//   Callable<T, ArgTypes&&...>::result_type 
//   operator()(ArgTypes&&... args) const;

#include <functional>
#include <cassert>

// 0 args, return int

int count = 0;

int f_int_0()
{
    return 3;
}

struct A_int_0
{
    int operator()() {return 4;}
};

void
test_int_0()
{
    // function
    {
    std::reference_wrapper<int ()> r1(f_int_0);
    assert(r1() == 3);
    }
    // function pointer
    {
    int (*fp)() = f_int_0;
    std::reference_wrapper<int (*)()> r1(fp);
    assert(r1() == 3);
    }
    // functor
    {
    A_int_0 a0;
    std::reference_wrapper<A_int_0> r1(a0);
    assert(r1() == 4);
    }
}


// 1 arg, return void

void f_void_1(int i)
{
    count += i;
}

struct A_void_1
{
    void operator()(int i)
    {
        count += i;
    }
};

int main()
{
    test_int_0();
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <class... ArgTypes>
+//   requires Callable<T, ArgTypes&&...>
+//   Callable<T, ArgTypes&&...>::result_type
+//   operator()(ArgTypes&&... args) const;
+
+#include <functional>
+#include <cassert>
+
+// 0 args, return int
+
+int count = 0;
+
+int f_int_0()
+{
+    return 3;
+}
+
+struct A_int_0
+{
+    int operator()() {return 4;}
+};
+
+void
+test_int_0()
+{
+    // function
+    {
+    std::reference_wrapper<int ()> r1(f_int_0);
+    assert(r1() == 3);
+    }
+    // function pointer
+    {
+    int (*fp)() = f_int_0;
+    std::reference_wrapper<int (*)()> r1(fp);
+    assert(r1() == 3);
+    }
+    // functor
+    {
+    A_int_0 a0;
+    std::reference_wrapper<A_int_0> r1(a0);
+    assert(r1() == 4);
+    }
+}
+
+// 1 arg, return void
+
+void f_void_1(int i)
+{
+    count += i;
+}
+
+struct A_void_1
+{
+    void operator()(int i)
+    {
+        count += i;
+    }
+};
+
+int main()
+{
+    test_int_0();
+}

+ 68 - 1
test/utilities/function.objects/refwrap/refwrap.invoke/invoke_void_0.pass.cpp

@@ -1 +1,68 @@
-//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <functional>

// reference_wrapper

// template <class... ArgTypes> 
//   requires Callable<T, ArgTypes&&...> 
//   Callable<T, ArgTypes&&...>::result_type 
//   operator()(ArgTypes&&... args) const;

#include <functional>
#include <cassert>

// 0 args, return void

int count = 0;

void f_void_0()
{
    ++count;
}

struct A_void_0
{
    void operator()() {++count;}
};

void
test_void_0()
{
    int save_count = count;
    // function
    {
    std::reference_wrapper<void ()> r1(f_void_0);
    r1();
    assert(count == save_count+1);
    save_count = count;
    }
    // function pointer
    {
    void (*fp)() = f_void_0;
    std::reference_wrapper<void (*)()> r1(fp);
    r1();
    assert(count == save_count+1);
    save_count = count;
    }
    // functor
    {
    A_void_0 a0;
    std::reference_wrapper<A_void_0> r1(a0);
    r1();
    assert(count == save_count+1);
    save_count = count;
    }
}

int main()
{
    test_void_0();
}
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// reference_wrapper
+
+// template <class... ArgTypes>
+//   requires Callable<T, ArgTypes&&...>
+//   Callable<T, ArgTypes&&...>::result_type
+//   operator()(ArgTypes&&... args) const;
+
+#include <functional>
+#include <cassert>
+
+// 0 args, return void
+
+int count = 0;
+
+void f_void_0()
+{
+    ++count;
+}
+
+struct A_void_0
+{
+    void operator()() {++count;}
+};
+
+void
+test_void_0()
+{
+    int save_count = count;
+    // function
+    {
+    std::reference_wrapper<void ()> r1(f_void_0);
+    r1();
+    assert(count == save_count+1);
+    save_count = count;
+    }
+    // function pointer
+    {
+    void (*fp)() = f_void_0;
+    std::reference_wrapper<void (*)()> r1(fp);
+    r1();
+    assert(count == save_count+1);
+    save_count = count;
+    }
+    // functor
+    {
+    A_void_0 a0;
+    std::reference_wrapper<A_void_0> r1(a0);
+    r1();
+    assert(count == save_count+1);
+    save_count = count;
+    }
+}
+
+int main()
+{
+    test_void_0();
+}

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott