[libcxx] r342855 - [libcxx] Fix the binder deprecation tests on Clang 5.

Louis Dionne ldionne at apple.com
Sun Sep 23 16:17:48 PDT 2018


Author: ldionne
Date: Sun Sep 23 16:17:48 2018
New Revision: 342855

URL: http://llvm.org/viewvc/llvm-project?rev=342855&view=rev
Log:
[libcxx] Fix the binder deprecation tests on Clang 5.

Tested on Docker containers with Clang 4, 5 and 6.

Modified:
    libcxx/trunk/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
    libcxx/trunk/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
    libcxx/trunk/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp
    libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp
    libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp
    libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp
    libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp
    libcxx/trunk/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp
    libcxx/trunk/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp
    libcxx/trunk/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp
    libcxx/trunk/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp

Modified: libcxx/trunk/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp (original)
+++ libcxx/trunk/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp Sun Sep 23 16:17:48 2018
@@ -19,6 +19,7 @@
 //                    RandomNumberGenerator& rand);
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03, c++11
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -42,14 +43,8 @@ struct gen
 
 int main()
 {
-#if TEST_STD_VER < 14
-    // expected-no-diagnostics
-#else
-    // expected-error@* 1 {{'random_shuffle<int *>' is deprecated}}
-    // expected-error@* 1 {{'random_shuffle<int *, gen &>' is deprecated}}
-#endif
     int v[1] = {1};
-    std::random_shuffle(&v[0], &v[1]);
+    std::random_shuffle(&v[0], &v[1]); // expected-error{{'random_shuffle<int *>' is deprecated}}
     gen r;
-    std::random_shuffle(&v[0], &v[1], r);
+    std::random_shuffle(&v[0], &v[1], r); // expected-error{{'random_shuffle<int *, gen &>' is deprecated}}
 }

Modified: libcxx/trunk/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp (original)
+++ libcxx/trunk/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp Sun Sep 23 16:17:48 2018
@@ -20,6 +20,7 @@
 // Deprecated in C++11
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -32,14 +33,7 @@
 
 int main()
 {
-#if TEST_STD_VER < 11
-    // expected-no-diagnostics
-#else
-    // expected-error@* 1 {{'auto_ptr<int>' is deprecated}}
-    // expected-error@* 1 {{'auto_ptr<void>' is deprecated}}
-    // expected-error@* 1 {{'auto_ptr_ref<int>' is deprecated}}
-#endif
-    typedef std::auto_ptr<int> AP;
-    typedef std::auto_ptr<void> APV;
-    typedef std::auto_ptr_ref<int> APR;
+    typedef std::auto_ptr<int> AP; // expected-error{{'auto_ptr<int>' is deprecated}}
+    typedef std::auto_ptr<void> APV; // expected-error{{'auto_ptr<void>' is deprecated}}
+    typedef std::auto_ptr_ref<int> APR; // expected-error{{'auto_ptr_ref<int>' is deprecated}}
 }

Modified: libcxx/trunk/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp (original)
+++ libcxx/trunk/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp Sun Sep 23 16:17:48 2018
@@ -10,6 +10,7 @@
 // <functional>
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -33,48 +34,26 @@ struct Foo {
 
 int main()
 {
-#if TEST_STD_VER < 11
-    // expected-no-diagnostics
-#else
-    // expected-error@* 1 {{'pointer_to_unary_function<int, int>' is deprecated}}
-    // expected-error@* 1 {{'pointer_to_binary_function<int, int, int>' is deprecated}}
-    // expected-error@* 1 {{'ptr_fun<int, int>' is deprecated}}
-    // expected-error@* 1 {{'ptr_fun<int, int, int>' is deprecated}}
-
-    // expected-error@* 1 {{'mem_fun_t<int, Foo>' is deprecated}}
-    // expected-error@* 1 {{'mem_fun1_t<int, Foo, int>' is deprecated}}
-    // expected-error@* 1 {{'const_mem_fun_t<int, Foo>' is deprecated}}
-    // expected-error@* 1 {{'const_mem_fun1_t<int, Foo, int>' is deprecated}}
-    // expected-error@* 2 {{'mem_fun<int, Foo>' is deprecated}}
-    // expected-error@* 2 {{'mem_fun<int, Foo, int>' is deprecated}}
-
-    // expected-error@* 1 {{'mem_fun_ref_t<int, Foo>' is deprecated}}
-    // expected-error@* 1 {{'mem_fun1_ref_t<int, Foo, int>' is deprecated}}
-    // expected-error@* 1 {{'const_mem_fun_ref_t<int, Foo>' is deprecated}}
-    // expected-error@* 1 {{'const_mem_fun1_ref_t<int, Foo, int>' is deprecated}}
-    // expected-error@* 2 {{'mem_fun_ref<int, Foo>' is deprecated}}
-    // expected-error@* 2 {{'mem_fun_ref<int, Foo, int>' is deprecated}}
-#endif
-    typedef std::pointer_to_unary_function<int, int> PUF;
-    typedef std::pointer_to_binary_function<int, int, int> PBF;
-    std::ptr_fun<int, int>(identity);
-    std::ptr_fun<int, int, int>(sum);
-
-    typedef std::mem_fun_t<int, Foo> MFT0;
-    typedef std::mem_fun1_t<int, Foo, int> MFT1;
-    typedef std::const_mem_fun_t<int, Foo> CMFT0;
-    typedef std::const_mem_fun1_t<int, Foo, int> CMFT1;
-    std::mem_fun<int, Foo>(&Foo::zero);
-    std::mem_fun<int, Foo, int>(&Foo::identity);
-    std::mem_fun<int, Foo>(&Foo::const_zero);
-    std::mem_fun<int, Foo, int>(&Foo::const_identity);
-
-    typedef std::mem_fun_ref_t<int, Foo> MFR0;
-    typedef std::mem_fun1_ref_t<int, Foo, int> MFR1;
-    typedef std::const_mem_fun_ref_t<int, Foo> CMFR0;
-    typedef std::const_mem_fun1_ref_t<int, Foo, int> CMFR1;
-    std::mem_fun_ref<int, Foo>(&Foo::zero);
-    std::mem_fun_ref<int, Foo, int>(&Foo::identity);
-    std::mem_fun_ref<int, Foo>(&Foo::const_zero);
-    std::mem_fun_ref<int, Foo, int>(&Foo::const_identity);
+    typedef std::pointer_to_unary_function<int, int> PUF; // expected-error{{'pointer_to_unary_function<int, int>' is deprecated}}
+    typedef std::pointer_to_binary_function<int, int, int> PBF; // expected-error{{'pointer_to_binary_function<int, int, int>' is deprecated}}
+    std::ptr_fun<int, int>(identity); // expected-error{{'ptr_fun<int, int>' is deprecated}}
+    std::ptr_fun<int, int, int>(sum); // expected-error{{'ptr_fun<int, int, int>' is deprecated}}
+
+    typedef std::mem_fun_t<int, Foo> MFT0; // expected-error{{'mem_fun_t<int, Foo>' is deprecated}}
+    typedef std::mem_fun1_t<int, Foo, int> MFT1; // expected-error{{'mem_fun1_t<int, Foo, int>' is deprecated}}
+    typedef std::const_mem_fun_t<int, Foo> CMFT0; // expected-error{{'const_mem_fun_t<int, Foo>' is deprecated}}
+    typedef std::const_mem_fun1_t<int, Foo, int> CMFT1; // expected-error{{'const_mem_fun1_t<int, Foo, int>' is deprecated}}
+    std::mem_fun<int, Foo>(&Foo::zero); // expected-error{{'mem_fun<int, Foo>' is deprecated}}
+    std::mem_fun<int, Foo, int>(&Foo::identity); // expected-error{{'mem_fun<int, Foo, int>' is deprecated}}
+    std::mem_fun<int, Foo>(&Foo::const_zero); // expected-error{{'mem_fun<int, Foo>' is deprecated}}
+    std::mem_fun<int, Foo, int>(&Foo::const_identity); // expected-error{{'mem_fun<int, Foo, int>' is deprecated}}
+
+    typedef std::mem_fun_ref_t<int, Foo> MFR0; // expected-error{{'mem_fun_ref_t<int, Foo>' is deprecated}}
+    typedef std::mem_fun1_ref_t<int, Foo, int> MFR1; // expected-error{{'mem_fun1_ref_t<int, Foo, int>' is deprecated}}
+    typedef std::const_mem_fun_ref_t<int, Foo> CMFR0; // expected-error{{'const_mem_fun_ref_t<int, Foo>' is deprecated}}
+    typedef std::const_mem_fun1_ref_t<int, Foo, int> CMFR1; // expected-error{{'const_mem_fun1_ref_t<int, Foo, int>' is deprecated}}
+    std::mem_fun_ref<int, Foo>(&Foo::zero); // expected-error{{'mem_fun_ref<int, Foo>' is deprecated}}
+    std::mem_fun_ref<int, Foo, int>(&Foo::identity); // expected-error{{'mem_fun_ref<int, Foo, int>' is deprecated}}
+    std::mem_fun_ref<int, Foo>(&Foo::const_zero); // expected-error{{'mem_fun_ref<int, Foo>' is deprecated}}
+    std::mem_fun_ref<int, Foo, int>(&Foo::const_identity); // expected-error{{'mem_fun_ref<int, Foo, int>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp Sun Sep 23 16:17:48 2018
@@ -12,6 +12,7 @@
 // bind1st
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -26,10 +27,5 @@
 
 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);
+    std::bind1st(test_func(1), 5); // expected-error{{'bind1st<test_func, int>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp Sun Sep 23 16:17:48 2018
@@ -12,6 +12,7 @@
 // bind2nd
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -26,10 +27,5 @@
 
 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);
+    std::bind2nd(test_func(1), 5); // expected-error{{'bind2nd<test_func, int>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp Sun Sep 23 16:17:48 2018
@@ -12,6 +12,7 @@
 // binder1st
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -26,10 +27,5 @@
 
 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;
+    typedef std::binder1st<test_func> B1ST; // expected-error{{'binder1st<test_func>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp (original)
+++ libcxx/trunk/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp Sun Sep 23 16:17:48 2018
@@ -12,6 +12,7 @@
 // binder2nd
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -26,10 +27,5 @@
 
 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;
+    typedef std::binder2nd<test_func> B2ND; // expected-error{{'binder2nd<test_func>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp Sun Sep 23 16:17:48 2018
@@ -13,6 +13,7 @@
 //  deprecated in C++17
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03, c++11, c++14
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -29,11 +30,6 @@ struct Predicate {
 };
 
 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()));
+    std::binary_negate<Predicate> f((Predicate())); // expected-error{{'binary_negate<Predicate>' is deprecated}}
     (void)f;
 }

Modified: libcxx/trunk/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp Sun Sep 23 16:17:48 2018
@@ -13,6 +13,7 @@
 //  deprecated in C++17
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03, c++11, c++14
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -28,10 +29,5 @@ struct Predicate {
 };
 
 int main() {
-#if TEST_STD_VER < 17
-    // expected-no-diagnostics
-#else
-    // expected-error@* 1 {{'not1<Predicate>' is deprecated}}
-#endif
-    std::not1(Predicate());
+    std::not1(Predicate()); // expected-error{{'not1<Predicate>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp Sun Sep 23 16:17:48 2018
@@ -13,6 +13,7 @@
 //  deprecated in C++17
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03, c++11, c++14
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -29,10 +30,5 @@ struct Predicate {
 };
 
 int main() {
-#if TEST_STD_VER < 17
-    // expected-no-diagnostics
-#else
-    // expected-error@* 1 {{'not2<Predicate>' is deprecated}}
-#endif
-    std::not2(Predicate());
+    std::not2(Predicate()); // expected-error{{'not2<Predicate>' is deprecated}}
 }

Modified: libcxx/trunk/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp?rev=342855&r1=342854&r2=342855&view=diff
==============================================================================
--- libcxx/trunk/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp (original)
+++ libcxx/trunk/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp Sun Sep 23 16:17:48 2018
@@ -13,6 +13,7 @@
 //  deprecated in C++17
 
 // UNSUPPORTED: clang-4.0
+// UNSUPPORTED: c++98, c++03, c++11, c++14
 // REQUIRES: verify-support
 
 // MODULES_DEFINES: _LIBCPP_ENABLE_DEPRECATION_WARNINGS
@@ -28,11 +29,6 @@ struct Predicate {
 };
 
 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()));
+    std::unary_negate<Predicate> f((Predicate())); // expected-error{{'unary_negate<Predicate>' is deprecated}}
     (void)f;
 }




More information about the libcxx-commits mailing list