]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/function/assign/move.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / function / assign / move.cc
index 7ed17c8acc8944a8e465996fd5cc9041542deb2a..8afdc8544acad8bc9f9ba52d50ac2262ee9d0131 100644 (file)
@@ -1,6 +1,7 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-do run { target c++11 } }
+// { dg-require-effective-target hosted }
 
-// Copyright (C) 2009-2013 Free Software Foundation, Inc.
+// Copyright (C) 2009-2024 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -25,8 +26,6 @@ struct { int operator()() { return 2; } } f2;
 
 void test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::function<int()> function;
 
   function fo(f1);
@@ -40,11 +39,12 @@ void test01()
   fo2 = (std::move(fo));
   VERIFY( static_cast<bool>(fo2) );
   VERIFY( fo2() == 2 );
+
+  static_assert(std::is_nothrow_move_assignable<function>::value,
+               "PR libstdc++/81017");
 }
 
 int main()
 {
   test01();
-
-  return 0;
 }