Make test helper work with non-copyable types
authorJonathan Wakely <jwakely@redhat.com>
Wed, 12 Oct 2016 13:30:49 +0000 (14:30 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 12 Oct 2016 13:30:49 +0000 (14:30 +0100)
* testsuite/util/testsuite_common_types.h
(bitwise_assignment_operators): Use direct-initialization for C++11
and later, to avoid CopyConstructible requirement.
* testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error
line numbers.
* testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc:
Adjust expected errors and line numbers.

From-SVN: r241047

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc
libstdc++-v3/testsuite/util/testsuite_common_types.h

index cda7761d6b654e6f38146682fa07e75216c234c0..633f4f1ad42f58752d1f132dd32078e3e2af2e01 100644 (file)
@@ -1,5 +1,16 @@
 2016-10-12  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/util/testsuite_common_types.h
+       (bitwise_assignment_operators): Use direct-initialization for C++11
+       and later, to avoid CopyConstructible requirement.
+       * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error
+       line numbers.
+       * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
+       * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise.
+       * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise.
+       * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc:
+       Adjust expected errors and line numbers.
+
        * include/std/mutex [_GLIBCXX_HAVE_TLS] (_Once_call): Remove.
        (call_once) [_GLIBCXX_HAVE_TLS]: Simplify by removing _Once_call.
 
index eb0111d4dc1fd204fd951ab43cf461c0fd9798a2..4136944b1628019b977a66520eb5cd8c558682d7 100644 (file)
@@ -27,5 +27,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 615 }
+// { dg-error "deleted" "" { target *-*-* } 620 }
 // { dg-prune-output "include" }
index 546ac50511995440701fa405ec56b7f13088e3d0..ffc2dc24179f22aa055f24bff643aa874133f405 100644 (file)
@@ -27,5 +27,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 654 }
+// { dg-error "deleted" "" { target *-*-* } 659 }
 // { dg-prune-output "include" }
index c5b6103f4deccada8717c7caacca5b8d14a9fb2f..20f263c79bd63c414f24518e4d8b4ad76e3753e9 100644 (file)
@@ -28,5 +28,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 615 }
+// { dg-error "deleted" "" { target *-*-* } 620 }
 // { dg-prune-output "include" }
index 49e1eb18347ab2137acf35e94f7d1820904af488..bf7cda86365830525cd2f673bc27cb821d17fe94 100644 (file)
@@ -28,5 +28,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 654 }
+// { dg-error "deleted" "" { target *-*-* } 659 }
 // { dg-prune-output "include" }
index db0c3c1e23ebd6ba219b8b45b84f673dc44135a0..731513b1ef5fc597d33b04a3f0c37dc294060ade 100644 (file)
@@ -26,10 +26,8 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 469 }
-// { dg-error "deleted" "" { target *-*-* } 470 }
-// { dg-error "operator" "" { target *-*-* } 471 }
-// { dg-error "operator" "" { target *-*-* } 472 }
-// { dg-error "operator" "" { target *-*-* } 473 }
+// { dg-error "operator" "" { target *-*-* } 476 }
+// { dg-error "operator" "" { target *-*-* } 477 }
+// { dg-error "operator" "" { target *-*-* } 478 }
 
 // { dg-prune-output "declared here" }
index 2f3732ebe2cc720a15086239356fadeb12196858..323367699e56b68ff2264fe297f1e9d8206d070a 100644 (file)
@@ -466,8 +466,13 @@ namespace __gnu_test
     void
     bitwise_assignment_operators()
     {
+#if __cplusplus >= 201103L
+      _Tp a{};
+      _Tp b{};
+#else
       _Tp a = _Tp();
       _Tp b = _Tp();
+#endif
       a |= b; // set
       a &= ~b; // clear
       a ^= b;