default.cc: Avoid -Wall warnings.
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 25 Jun 2008 23:28:14 +0000 (23:28 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 25 Jun 2008 23:28:14 +0000 (23:28 +0000)
2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>

* testsuite/29_atomics/atomic_flag/cons/default.cc: Avoid -Wall
warnings.
* testsuite/29_atomics/atomic_flag/cons/aggregate.cc: Likewise.
* testsuite/29_atomics/headers/cstdatomic/types_std_c++0x.cc:
Likewise.
* testsuite/29_atomics/headers/stdatomic.h/types.c: Likewise.
* testsuite/util/testsuite_common_types.h (struct assignable,
struct default_constructible, struct copy_constructible,
struct explicit_value_constructible): Use a tad of simulated
concept checking techniques to avoid spurious warnings.
* testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error
markers.
* testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.

From-SVN: r137127

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_flag/cons/aggregate.cc
libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/default.cc
libstdc++-v3/testsuite/29_atomics/headers/cstdatomic/types_std_c++0x.cc
libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/types.c
libstdc++-v3/testsuite/util/testsuite_common_types.h

index 093c030489fd6316a15cf30c8ad085dc41eff758..78c000ffb103e8846e7777053653eeb900ef0e66 100644 (file)
@@ -1,3 +1,19 @@
+2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * testsuite/29_atomics/atomic_flag/cons/default.cc: Avoid -Wall
+       warnings.
+       * testsuite/29_atomics/atomic_flag/cons/aggregate.cc: Likewise.
+       * testsuite/29_atomics/headers/cstdatomic/types_std_c++0x.cc:
+       Likewise.
+       * testsuite/29_atomics/headers/stdatomic.h/types.c: Likewise.
+       * testsuite/util/testsuite_common_types.h (struct assignable,
+       struct default_constructible, struct copy_constructible,
+       struct explicit_value_constructible): Use a tad of simulated
+       concept checking techniques to avoid spurious warnings.
+       * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust dg-error
+       markers.
+       * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise.
+
 2008-06-25  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/stl_algo.h (__find_if_not, find_if_not, all_of,
index a22a558f26e90d63508a73cebc88bd748b7c988d..2ad480a0fa7fb2a8c5ddb559ee9197919701f937 100644 (file)
@@ -38,8 +38,8 @@ int main()
   return 0;
 }
 
-// { dg-error "within this context" "" { target *-*-* } 309 } 
-// { dg-error "is private" "" { target *-*-* } 1750 } 
+// { dg-error "within this context" "" { target *-*-* } 310 }
+// { dg-error "is private" "" { target *-*-* } 1750 }
 // { dg-error "is private" "" { target *-*-* } 1782 } 
 // { dg-error "is private" "" { target *-*-* } 1799 }
 // { dg-error "is private" "" { target *-*-* } 1816 }
index 49125182ebb4a71bc20d69e8ce7e578058e0f5ee..a78177eee56f4d81b46b01f2af8f2a0999dd41c6 100644 (file)
@@ -38,9 +38,9 @@ int main()
   return 0;
 }
 
-// { dg-error "within this context" "" { target *-*-* } 332 } 
-// { dg-error "is private" "" { target *-*-* } 1749 } 
-// { dg-error "is private" "" { target *-*-* } 1781 } 
+// { dg-error "within this context" "" { target *-*-* } 349 } 
+// { dg-error "is private" "" { target *-*-* } 1749 }
+// { dg-error "is private" "" { target *-*-* } 1781 }
 // { dg-error "is private" "" { target *-*-* } 1798 }
 // { dg-error "is private" "" { target *-*-* } 1814 }
 // { dg-error "is private" "" { target *-*-* } 1831 }
index 151d85fc05062fb11d929c1661c7cf273cb93c55..e7a046f89b62cdd5d2e74cee4eef2643e7cc4016 100644 (file)
@@ -33,6 +33,6 @@
 int main()
 {
   // Only safe usage.
-  std::atomic_flag guard = ATOMIC_FLAG_INIT;
+  std::atomic_flag guard __attribute__((unused)) = ATOMIC_FLAG_INIT;
   return 0;
 }
index b4fa3a755b2c12c20cc5082578f2d4cc2606fbf3..591a3f295c781a89110716b8ec51fe8564677fd0 100644 (file)
@@ -32,6 +32,6 @@
 int main()
 {
   // Default constructor.
-  std::atomic_flag a;
+  std::atomic_flag a __attribute__((unused));
   return 0;
 }
index 31b32c138136bba002a888c96ba6ac741bb575ef..9a3ab5e636f6e0c5f9b74fffd665778615df9fc8 100644 (file)
@@ -76,5 +76,6 @@ void test01()
 
   using std::atomic_address;
 
-  &std::atomic_global_fence_compatibility;
+  const std::atomic_flag* p __attribute__((unused))
+    = &std::atomic_global_fence_compatibility;
 }
index 8e9cfd56e0174ad36977b91f16482c91085718e2..88bc740c3d7879accf8cb9a17e01afa2b9b519bb 100644 (file)
 void test01()
 {
   typedef memory_order t_01;
-  memory_order t_02 = memory_order_relaxed;
-  memory_order t_03 = memory_order_acquire;
-  memory_order t_04 = memory_order_release;
-  memory_order t_05 = memory_order_acq_rel;
-  memory_order t_06 = memory_order_seq_cst;
+  memory_order t_02 __attribute__((unused)) = memory_order_relaxed;
+  memory_order t_03 __attribute__((unused)) = memory_order_acquire;
+  memory_order t_04 __attribute__((unused)) = memory_order_release;
+  memory_order t_05 __attribute__((unused)) = memory_order_acq_rel;
+  memory_order t_06 __attribute__((unused)) = memory_order_seq_cst;
 
   typedef atomic_flag t_07;
 
@@ -76,5 +76,6 @@ void test01()
 
   typedef atomic_address t_46;
 
-  &atomic_global_fence_compatibility;
+  const atomic_flag* p __attribute__((unused))
+    = &atomic_global_fence_compatibility;
 }
index 35bd907d8da46c95537bd53290056724c9b59713..a746d787e7ce44103658a7a0a66a8bb436839b47 100644 (file)
@@ -300,36 +300,59 @@ namespace __gnu_test
   // Generator to test assignment operator.
   struct assignable
   {
-    template<typename _T>
+    template<typename _Tp>
       void 
       operator()()
       {
-        _T v1;
-        _T v2;
-        v1 = v2;
+       struct _Concept
+       {
+         void __constraint()
+         { __v1 = __v2; }
+
+         _Tp __v1;
+         _Tp __v2;
+       };
+
+       void (_Concept::*__x)() __attribute__((unused))
+         = &_Concept::__constraint;
       }
   };
 
   // Generator to test default constructor.
   struct default_constructible
   {
-    template<typename _T>
+    template<typename _Tp>
       void 
       operator()()
       {
-        _T v;
+       struct _Concept
+       {
+         void __constraint()
+         { _Tp __v; }
+       };
+
+       void (_Concept::*__x)() __attribute__((unused))
+         = &_Concept::__constraint;
       }
   };
 
   // Generator to test copy constructor.
   struct copy_constructible
   {
-    template<typename _T>
+    template<typename _Tp>
       void 
       operator()()
       {
-        _T v1;
-        _T v2(v1);
+       struct _Concept
+       {
+         void __constraint()
+         { _Tp __v2(__v1); }
+
+         _Tp __v1;
+       };
+
+       void (_Concept::*__x)() __attribute__((unused))
+         = &_Concept::__constraint;
       }
   };
 
@@ -340,8 +363,16 @@ namespace __gnu_test
       void 
       operator()()
       {
-        _Tvalue a;
-       _Ttype v(a);
+       struct _Concept
+       {
+         void __constraint()
+         { _Ttype __v(__a); }
+         
+         _Tvalue __a;
+       };
+
+       void (_Concept::*__x)() __attribute__((unused))
+         = &_Concept::__constraint;
       }
   };