diff options
Diffstat (limited to 'libcxx/test/std')
8 files changed, 284 insertions, 0 deletions
diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp new file mode 100644 index 00000000000..3688d8ba89e --- /dev/null +++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <functional> +// +// bind1st + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +// MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS + +#include <functional> + +#include "../test_func.h" +#include "test_macros.h" + +int main() +{ +#if TEST_STD_VER < 11 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'bind1st<test_func, int>' is deprecated}} +#endif + std::bind1st(test_func(1), 5); +} diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp new file mode 100644 index 00000000000..caf6d64b0ca --- /dev/null +++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <functional> +// +// bind2nd + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +// MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS + +#include <functional> + +#include "../test_func.h" +#include "test_macros.h" + +int main() +{ +#if TEST_STD_VER < 11 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'bind2nd<test_func, int>' is deprecated}} +#endif + std::bind2nd(test_func(1), 5); +} diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp new file mode 100644 index 00000000000..49d4b0cb29e --- /dev/null +++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <functional> +// +// binder1st + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +// MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS + +#include <functional> + +#include "../test_func.h" +#include "test_macros.h" + +int main() +{ +#if TEST_STD_VER < 11 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'binder1st<test_func>' is deprecated}} +#endif + typedef std::binder1st<test_func> B1ST; +} diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp new file mode 100644 index 00000000000..c8a86674c3f --- /dev/null +++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp @@ -0,0 +1,34 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <functional> +// +// binder2nd + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +// MODULES_DEFINES: _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS + +#include <functional> + +#include "../test_func.h" +#include "test_macros.h" + +int main() +{ +#if TEST_STD_VER < 11 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'binder2nd<test_func>' is deprecated}} +#endif + typedef std::binder2nd<test_func> B2ND; +} diff --git a/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp new file mode 100644 index 00000000000..6ad3f7f3117 --- /dev/null +++ b/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp @@ -0,0 +1,38 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// binary_negate +// deprecated in C++17 + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS + +#include <functional> + +#include "test_macros.h" + +struct Predicate { + typedef int first_argument_type; + typedef int second_argument_type; + bool operator()(first_argument_type, second_argument_type) const { return true; } +}; + +int main() { +#if TEST_STD_VER < 17 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'binary_negate<Predicate>' is deprecated}} +#endif + std::binary_negate<Predicate> f((Predicate())); + (void)f; +} diff --git a/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp new file mode 100644 index 00000000000..a2f7f65b1c4 --- /dev/null +++ b/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp @@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// not1 +// deprecated in C++17 + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS + +#include <functional> + +#include "test_macros.h" + +struct Predicate { + typedef int argument_type; + bool operator()(argument_type) const { return true; } +}; + +int main() { +#if TEST_STD_VER < 17 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'not1<Predicate>' is deprecated}} +#endif + std::not1(Predicate()); +} diff --git a/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp new file mode 100644 index 00000000000..a858014596e --- /dev/null +++ b/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.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. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// not2 +// deprecated in C++17 + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS + +#include <functional> + +#include "test_macros.h" + +struct Predicate { + typedef int first_argument_type; + typedef int second_argument_type; + bool operator()(first_argument_type, second_argument_type) const { return true; } +}; + +int main() { +#if TEST_STD_VER < 17 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'not2<Predicate>' is deprecated}} +#endif + std::not2(Predicate()); +} diff --git a/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp new file mode 100644 index 00000000000..3df852166fe --- /dev/null +++ b/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.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. +// +//===----------------------------------------------------------------------===// + +// <functional> + +// unary_negate +// deprecated in C++17 + +// REQUIRES: verify-support + +// MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS +#define _LIBCPP_ENABLE_DEPRECATION_WARNINGS + +#include <functional> + +#include "test_macros.h" + +struct Predicate { + typedef int argument_type; + bool operator()(argument_type) const { return true; } +}; + +int main() { +#if TEST_STD_VER < 17 + // expected-no-diagnostics +#else + // expected-error@* 1 {{'unary_negate<Predicate>' is deprecated}} +#endif + std::unary_negate<Predicate> f((Predicate())); + (void)f; +} |