Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -1086,6 +1086,7 @@ # define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR # define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS # define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE +# define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS #endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES #if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611 Index: include/functional =================================================================== --- include/functional +++ include/functional @@ -235,7 +235,7 @@ } template -class binder1st +class binder1st // deprecated in C++11, removed in C++17 : public unary_function { @@ -249,10 +249,10 @@ }; template -binder1st bind1st(const Operation& op, const T& x); +binder1st bind1st(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 template -class binder2nd +class binder2nd // deprecated in C++11, removed in C++17 : public unary_function { @@ -266,9 +266,9 @@ }; template -binder2nd bind2nd(const Operation& op, const T& x); +binder2nd bind2nd(const Operation& op, const T& x); // deprecated in C++11, removed in C++17 -template +template // deprecated in C++11, removed in C++17 class pointer_to_unary_function : public unary_function { public: @@ -277,9 +277,9 @@ }; template -pointer_to_unary_function ptr_fun(Result (*f)(Arg)); +pointer_to_unary_function ptr_fun(Result (*f)(Arg)); // deprecated in C++11, removed in C++17 -template +template // deprecated in C++11, removed in C++17 class pointer_to_binary_function : public binary_function { public: @@ -288,9 +288,9 @@ }; template -pointer_to_binary_function ptr_fun(Result (*f)(Arg1,Arg2)); +pointer_to_binary_function ptr_fun(Result (*f)(Arg1,Arg2)); // deprecated in C++11, removed in C++17 -template +template // deprecated in C++11, removed in C++17 class mem_fun_t : public unary_function { public: @@ -299,7 +299,7 @@ }; template -class mem_fun1_t : public binary_function +class mem_fun1_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit mem_fun1_t(S (T::*p)(A)); @@ -306,11 +306,11 @@ S operator()(T* p, A x) const; }; -template mem_fun_t mem_fun(S (T::*f)()); -template mem_fun1_t mem_fun(S (T::*f)(A)); +template mem_fun_t mem_fun(S (T::*f)()); // deprecated in C++11, removed in C++17 +template mem_fun1_t mem_fun(S (T::*f)(A)); // deprecated in C++11, removed in C++17 template -class mem_fun_ref_t : public unary_function +class mem_fun_ref_t : public unary_function // deprecated in C++11, removed in C++17 { public: explicit mem_fun_ref_t(S (T::*p)()); @@ -318,7 +318,7 @@ }; template -class mem_fun1_ref_t : public binary_function +class mem_fun1_ref_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit mem_fun1_ref_t(S (T::*p)(A)); @@ -325,11 +325,11 @@ S operator()(T& p, A x) const; }; -template mem_fun_ref_t mem_fun_ref(S (T::*f)()); -template mem_fun1_ref_t mem_fun_ref(S (T::*f)(A)); +template mem_fun_ref_t mem_fun_ref(S (T::*f)()); // deprecated in C++11, removed in C++17 +template mem_fun1_ref_t mem_fun_ref(S (T::*f)(A)); // deprecated in C++11, removed in C++17 template -class const_mem_fun_t : public unary_function +class const_mem_fun_t : public unary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun_t(S (T::*p)() const); @@ -337,7 +337,7 @@ }; template -class const_mem_fun1_t : public binary_function +class const_mem_fun1_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun1_t(S (T::*p)(A) const); @@ -344,11 +344,11 @@ S operator()(const T* p, A x) const; }; -template const_mem_fun_t mem_fun(S (T::*f)() const); -template const_mem_fun1_t mem_fun(S (T::*f)(A) const); +template const_mem_fun_t mem_fun(S (T::*f)() const); // deprecated in C++11, removed in C++17 +template const_mem_fun1_t mem_fun(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 template -class const_mem_fun_ref_t : public unary_function +class const_mem_fun_ref_t : public unary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun_ref_t(S (T::*p)() const); @@ -356,7 +356,7 @@ }; template -class const_mem_fun1_ref_t : public binary_function +class const_mem_fun1_ref_t : public binary_function // deprecated in C++11, removed in C++17 { public: explicit const_mem_fun1_ref_t(S (T::*p)(A) const); @@ -363,8 +363,8 @@ S operator()(const T& p, A x) const; }; -template const_mem_fun_ref_t mem_fun_ref(S (T::*f)() const); -template const_mem_fun1_ref_t mem_fun_ref(S (T::*f)(A) const); +template const_mem_fun_ref_t mem_fun_ref(S (T::*f)() const); // deprecated in C++11, removed in C++17 +template const_mem_fun1_ref_t mem_fun_ref(S (T::*f)(A) const); // deprecated in C++11, removed in C++17 template unspecified mem_fn(R T::*); @@ -1020,6 +1020,7 @@ binary_negate<_Predicate> not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);} +#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS) template class _LIBCPP_TEMPLATE_VIS binder1st : public unary_function mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const) {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);} +#endif //////////////////////////////////////////////////////////////////////////////// // MEMFUN Index: test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp =================================================================== --- test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp +++ test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp @@ -0,0 +1,47 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + + +// In C++17, the function adapters mem_fun/mem_fun_ref, etc have been removed. +// However, for backwards compatibility, if _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +// is defined before including , then they will be restored. + +#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS + +#include +#include + +int identity(int v) { return v; } +int sum(int a, int b) { return a + b; } + +struct Foo { + int zero() const { return 0; } + int identity(int v) const { return v; } + int sum(int a, int b) const { return a + b; } +}; + +int main() +{ + typedef std::pointer_to_unary_function PUF; + typedef std::pointer_to_binary_function PBF; + assert((std::ptr_fun(identity)(4) == 4)); + assert((std::ptr_fun(sum)(4, 5) == 9)); + + Foo f; + assert((std::mem_fn(&Foo::identity)(f, 5) == 5)); + assert((std::mem_fn(&Foo::sum)(f, 5, 6) == 11)); + + typedef std::mem_fun_ref_t MFR; + typedef std::const_mem_fun_ref_t CMFR; + + assert((std::mem_fun_ref(&Foo::zero)(f) == 0)); + assert((std::mem_fun_ref(&Foo::identity)(f, 5) == 5)); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.fail.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// pointer_to_binary_function + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +double binary_f(int i, short j) {return i - j + .75;} + +int main() +{ + typedef std::pointer_to_binary_function F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // pointer_to_binary_function Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.fail.cpp @@ -0,0 +1,28 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// pointer_to_unary_function + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +double unary_f(int i) {return 0.5 - i;} + +int main() +{ + typedef std::pointer_to_unary_function F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // pointer_to_unary_function Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.fail.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// pointer_to_unary_function +// ptr_fun(Result (*f)(Arg)); + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +double unary_f(int i) {return 0.5 - i;} + +int main() +{ + assert(std::ptr_fun(unary_f)(36) == -35.5); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // pointer_to_unary_function Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.fail.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// pointer_to_binary_function +// ptr_fun(Result (*f)(Arg1, Arg2)); + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +double binary_f(int i, short j) {return i - j + .75;} + +int main() +{ + assert(std::ptr_fun(binary_f)(36, 27) == 9.75); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // pointer_to_binary_function Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// const_mem_fun_t +// mem_fun(S (T::*f)() const); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // const_mem_fun_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// const_mem_fun1_t +// mem_fun(S (T::*f)(A) const); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // const_mem_fun1_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// const_mem_fun1_ref_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // const_mem_fun1_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// const_mem_fun1_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // const_mem_fun1_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// const_mem_fun_ref_t +// mem_fun_ref(S (T::*f)() const); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // const_mem_fun_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// const_mem_fun1_ref_t +// mem_fun_ref(S (T::*f)(A) const); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // const_mem_fun1_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// const_mem_fun_ref_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // const_mem_fun_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// const_mem_fun_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // const_mem_fun_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// mem_fun_t +// mem_fun(S (T::*f)()); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // mem_fun_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// mem_fun1_t +// mem_fun(S (T::*f)(A)); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // mem_fun1_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// mem_fun1_ref_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // mem_fun1_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// mem_fun1_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // mem_fun1_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// mem_fun_ref_t +// mem_fun_ref(S (T::*f)()); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // mem_fun_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp @@ -0,0 +1,37 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template +// mem_fun1_ref_t +// mem_fun_ref(S (T::*f)(A)); +// Removed in c++1z + +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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); +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // mem_fun1_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// mem_fun_ref_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // mem_fun_ref_t Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// mem_fun_t +// Removed in c++1z + +#include +#include +#include + +#include "test_macros.h" +#if TEST_STD_VER <= 14 +#error +#endif + +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 F; +} Index: test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp =================================================================== --- test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp +++ test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // mem_fun_t Index: test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp =================================================================== --- test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp +++ test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // binder1st Index: test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp =================================================================== --- test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp +++ test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // binder2nd Index: test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp =================================================================== --- test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp +++ test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // class binder1st Index: test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp =================================================================== --- test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp +++ test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// // +// REQUIRES: c++98 || c++03 || c++11 || c++14 // template // class binder2nd