]> gcc.gnu.org Git - gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/bind/cv_quals_2.cc
libstdc++: Disable volatile-qualified std::bind for C++20
[gcc.git] / libstdc++-v3 / testsuite / 20_util / bind / cv_quals_2.cc
index 7a85568c66af9953db98f0f12fd259c6b9f0ef94..d2ebad72fdf5d6a4b31b53baea95930c5fccf836 100644 (file)
@@ -15,7 +15,9 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-do run { target c++11 } }
+// { dg-options "-Wdeprecated-declarations" }
+// { dg-do run { target { c++11 && c++17_down } } }
+// { dg-do compile { target c++20 } }
 
 #include <functional>
 #include <testsuite_hooks.h>
@@ -33,13 +35,13 @@ void test01()
   const auto b0 = std::bind(X());
   VERIFY( b0() == 0 );
 
-#if __cplusplus <= 201402L
   volatile auto b1 = std::bind(X());
-  VERIFY( b1() == 1 );
+  VERIFY( b1() == 1 ); // { dg-warning "deprecated" "" { target c++17_only } }
+                      // { dg-error "no match" "" { target c++20 } 39 }
 
   const volatile auto b2 = std::bind(X());
-  VERIFY( b2() == 2 );
-#endif
+  VERIFY( b2() == 2 ); // { dg-warning "deprecated" "" { target c++17_only } }
+                      // { dg-error "no match" "" { target c++20 } 43 }
 }
 
 int main()
This page took 0.029433 seconds and 5 git commands to generate.