]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/20_util/is_nothrow_move_assignable/value.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 20_util / is_nothrow_move_assignable / value.cc
index 54d94c2f234629e5fd578c5b841f157a6ade28d8..154eb88e0b7e4234021c0a4efb4be570767e04ab 100644 (file)
@@ -1,7 +1,8 @@
-// { dg-options "-std=gnu++0x" }
+// { dg-do compile { target c++11 } }
+
 // 2011-05-19  Paolo Carlini  <paolo.carlini@oracle.com>
 //
-// Copyright (C) 2011-2013 Free Software Foundation, Inc.
+// Copyright (C) 2011-2020 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
 // <http://www.gnu.org/licenses/>.
 
 #include <type_traits>
-#include <testsuite_hooks.h>
 #include <testsuite_tr1.h>
 
 void test01()
 {
-  bool test __attribute__((unused)) = true;
   using std::is_nothrow_move_assignable;
   using namespace __gnu_test;
 
   // Positive tests.
-  VERIFY( (test_property<is_nothrow_move_assignable, int>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, float>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, EnumType>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, int*>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, int(*)(int)>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          int (ClassType::*)>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          int (ClassType::*) (int)>(true)) );
+  static_assert(test_property<is_nothrow_move_assignable, int>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable, float>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable, EnumType>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable, int*>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               int(*)(int)>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               int (ClassType::*)>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               int (ClassType::*) (int)>(true), "");
 
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          NoexceptMoveAssignClass>(true)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          NoexceptCopyAssignClass>(true)) );
+  static_assert(test_property<is_nothrow_move_assignable,
+               NoexceptMoveAssignClass>(true), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               NoexceptCopyAssignClass>(true), "");
 
   // Negative tests.
-  VERIFY( (test_property<is_nothrow_move_assignable, void>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, int[2]>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, float[][3]>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          EnumType[2][3][4]>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, int*[3]>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          int(*[][2])(int)>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          int (ClassType::*[2][3])>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, 
-          int (ClassType::*[][2][3]) (int)>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, 
-       ClassType(unsigned) const &>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, 
-       bool(ClassType) const>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, 
-       bool(...) &&>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable, 
-       EnumType(int, ...)>(false)) );
-
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          ExceptMoveAssignClass>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          ExceptCopyAssignClass>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          DeletedMoveAssignClass>(false)) );
-  VERIFY( (test_property<is_nothrow_move_assignable,
-          DeletedCopyAssignClass>(false)) );
-}
+  static_assert(test_property<is_nothrow_move_assignable, void>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable, int[2]>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               float[][3]>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               EnumType[2][3][4]>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable, int*[3]>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               int(*[][2])(int)>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               int (ClassType::*[2][3])>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable, 
+               int (ClassType::*[][2][3]) (int)>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               ClassType(unsigned) const &>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               bool(ClassType) const>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable, 
+               bool(...) &&>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable, 
+               EnumType(int, ...)>(false), "");
 
-int main()
-{
-  test01();
-  return 0;
+  static_assert(test_property<is_nothrow_move_assignable,
+               ExceptMoveAssignClass>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               ExceptCopyAssignClass>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               DeletedMoveAssignClass>(false), "");
+  static_assert(test_property<is_nothrow_move_assignable,
+               DeletedCopyAssignClass>(false), "");
 }