]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
random.h (linear_congruential_engine(_Sseq&), [...]): Do not enable for the type...
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 16 Feb 2010 19:19:55 +0000 (19:19 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 16 Feb 2010 19:19:55 +0000 (19:19 +0000)
2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>

* include/bits/random.h (linear_congruential_engine(_Sseq&),
mersenne_twister_engine(_Sseq&), subtract_with_carry_engine(_Sseq&)):
Do not enable for the type itself.
(discard_block_engine(_Sseq&), independent_bits_engine(_Sseq&),
shuffle_order_engine(_Sseq&)): Do not enable for the type itself too.
(linear_congruential_engine<>::seed(_Sseq&),
mersenne_twister_engine<>::seed(_Sseq&),
subtract_with_carry_engine<>::seed(_Sseq&)): Use enable_if on the
return type.
(discard_block_engine<>::seed(_Sseq&),
independent_bits_engine<>::seed(_Sseq&),
shuffle_order_engine<>::seed(_Sseq&)): Do not use enable_if.
* include/bits/random.tcc: Adjust definitions.
* testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc:
New.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
copy.cc: Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/
copy.cc: Likewise.

* testsuite/26_numerics/random/independent_bits_engine/cons/
base_move.cc: Minor tweaks.
* testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
base_copy.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/independent_bits_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed1.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed2.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/subtract_with_carry_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc:
Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc:
Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
default.cc: Likewise.
* testsuite/26_numerics/random/mersenne_twister_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed1.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed2.cc: Likewise.
* testsuite/26_numerics/random/linear_congruential_engine/cons/
seed_seq.cc: Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc:
Likewise.
  * testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc:
Likewise.
* testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc:
Likewise.

From-SVN: r156815

38 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/random.h
libstdc++-v3/include/bits/random.tcc
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc
libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_copy.cc
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/base_move.cc
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc
libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/seed_seq.cc
libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed1.cc
libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed2.cc
libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/seed_seq.cc
libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc
libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc
libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/seed_seq.cc
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc
libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc
libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/copy.cc [new file with mode: 0644]
libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/default.cc
libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed1.cc
libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed2.cc
libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/seed_seq.cc

index 183a4ccb8012e952d73366a548ee9a5b7e6f7641..7ea3348e9f93c2c7e1d2ad778338c3fbea5754b6 100644 (file)
@@ -1,3 +1,90 @@
+2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/bits/random.h (linear_congruential_engine(_Sseq&),
+       mersenne_twister_engine(_Sseq&), subtract_with_carry_engine(_Sseq&)):
+       Do not enable for the type itself.
+       (discard_block_engine(_Sseq&), independent_bits_engine(_Sseq&),
+       shuffle_order_engine(_Sseq&)): Do not enable for the type itself too.
+       (linear_congruential_engine<>::seed(_Sseq&),
+       mersenne_twister_engine<>::seed(_Sseq&),
+       subtract_with_carry_engine<>::seed(_Sseq&)): Use enable_if on the
+       return type.
+       (discard_block_engine<>::seed(_Sseq&),
+       independent_bits_engine<>::seed(_Sseq&),
+       shuffle_order_engine<>::seed(_Sseq&)): Do not use enable_if.
+       * include/bits/random.tcc: Adjust definitions.
+       * testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc:
+       New.
+       * testsuite/26_numerics/random/subtract_with_carry_engine/cons/
+       copy.cc: Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/
+       copy.cc: Likewise.
+       * testsuite/26_numerics/random/mersenne_twister_engine/cons/
+       copy.cc: Likewise.
+       * testsuite/26_numerics/random/linear_congruential_engine/cons/
+       copy.cc: Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/
+       copy.cc: Likewise.
+
+       * testsuite/26_numerics/random/independent_bits_engine/cons/
+       base_move.cc: Minor tweaks.
+       * testsuite/26_numerics/random/independent_bits_engine/cons/seed1.cc:
+       Likewise.
+       * testsuite/26_numerics/random/independent_bits_engine/cons/seed2.cc:
+       Likewise.
+       * testsuite/26_numerics/random/independent_bits_engine/cons/
+       base_copy.cc: Likewise.
+       * testsuite/26_numerics/random/independent_bits_engine/cons/
+       default.cc: Likewise.
+       * testsuite/26_numerics/random/independent_bits_engine/cons/
+       seed_seq.cc: Likewise.
+       * testsuite/26_numerics/random/subtract_with_carry_engine/cons/
+       seed1.cc: Likewise.
+       * testsuite/26_numerics/random/subtract_with_carry_engine/cons/
+       seed2.cc: Likewise.
+       * testsuite/26_numerics/random/subtract_with_carry_engine/cons/
+       default.cc: Likewise.
+       * testsuite/26_numerics/random/subtract_with_carry_engine/cons/
+       seed_seq.cc: Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/base_move.cc:
+       Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/seed1.cc:
+       Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/seed2.cc:
+       Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/base_copy.cc:
+       Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/discard_block_engine/cons/seed_seq.cc:
+       Likewise.
+       * testsuite/26_numerics/random/mersenne_twister_engine/cons/seed1.cc:
+       Likewise.
+       * testsuite/26_numerics/random/mersenne_twister_engine/cons/seed2.cc:
+       Likewise.
+       * testsuite/26_numerics/random/mersenne_twister_engine/cons/
+       default.cc: Likewise.
+       * testsuite/26_numerics/random/mersenne_twister_engine/cons/
+       seed_seq.cc: Likewise.
+       * testsuite/26_numerics/random/linear_congruential_engine/cons/
+       seed1.cc: Likewise.
+       * testsuite/26_numerics/random/linear_congruential_engine/cons/
+       seed2.cc: Likewise.
+       * testsuite/26_numerics/random/linear_congruential_engine/cons/
+       seed_seq.cc: Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/base_move.cc:
+       Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/seed1.cc:
+       Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/seed2.cc:
+       Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/base_copy.cc:
+       Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/default.cc:
+       Likewise.
+       * testsuite/26_numerics/random/shuffle_order_engine/cons/seed_seq.cc:
+       Likewise.
+
 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * include/bits/unique_ptr.h: (unique_ptr<>::
index b7ba1e0db51e96abcb09b87554c6afc45e094b64..648185dfe0f3db069fd7f4676b6ccbaf40c2df13 100644 (file)
@@ -188,11 +188,12 @@ namespace std
        *
        * @param __q the seed sequence.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
+      template<typename _Sseq, typename = typename
+       std::enable_if<!std::is_same<_Sseq, linear_congruential_engine>::value>
+              ::type>
         explicit
         linear_congruential_engine(_Sseq& __q)
-        { seed<_Sseq>(__q); }
+        { seed(__q); }
 
       /**
        * @brief Reseeds the %linear_congruential_engine random number generator
@@ -210,9 +211,8 @@ namespace std
        *
        * @param __q the seed sequence.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
-        void
+      template<typename _Sseq>
+        typename std::enable_if<std::is_class<_Sseq>::value>::type
         seed(_Sseq& __q);
 
       /**
@@ -403,18 +403,18 @@ namespace std
        *
        * @param __q the seed sequence.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
+      template<typename _Sseq, typename = typename
+        std::enable_if<!std::is_same<_Sseq, mersenne_twister_engine>::value>
+              ::type>
         explicit
         mersenne_twister_engine(_Sseq& __q)
-        { seed<_Sseq>(__q); }
+        { seed(__q); }
 
       void
       seed(result_type __sd = default_seed);
 
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
-        void
+      template<typename _Sseq>
+       typename std::enable_if<std::is_class<_Sseq>::value>::type
         seed(_Sseq& __q);
 
       /**
@@ -576,11 +576,12 @@ namespace std
        *
        * @param __q the seed sequence.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
+      template<typename _Sseq, typename = typename
+        std::enable_if<!std::is_same<_Sseq, subtract_with_carry_engine>::value>
+              ::type>
         explicit
         subtract_with_carry_engine(_Sseq& __q)
-        { seed<_Sseq>(__q); }
+        { seed(__q); }
 
       /**
        * @brief Seeds the initial state @f$x_0@f$ of the random number
@@ -601,9 +602,8 @@ namespace std
        * @brief Seeds the initial state @f$x_0@f$ of the
        * % subtract_with_carry_engine random number generator.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
-        void
+      template<typename _Sseq>
+       typename std::enable_if<std::is_class<_Sseq>::value>::type
         seed(_Sseq& __q);
 
       /**
@@ -767,10 +767,10 @@ namespace std
        *
        * @param __q A seed sequence.
        */
-      template<typename _Sseq, typename
-        = typename std::enable_if<std::is_class<_Sseq>::value
-                                 && !std::is_same<_Sseq, _RandomNumberEngine>
-                                 ::value>::type>
+      template<typename _Sseq, typename = typename
+       std::enable_if<!std::is_same<_Sseq, discard_block_engine>::value
+                      && !std::is_same<_Sseq, _RandomNumberEngine>::value>
+              ::type>
         explicit
         discard_block_engine(_Sseq& __q)
        : _M_b(__q), _M_n(0)
@@ -803,12 +803,11 @@ namespace std
        *        sequence.
        * @param __q A seed generator function.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
+      template<typename _Sseq>
         void
         seed(_Sseq& __q)
         {
-         _M_b.seed<_Sseq>(__q);
+         _M_b.seed(__q);
          _M_n = 0;
        }
 
@@ -971,10 +970,10 @@ namespace std
        *
        * @param __q A seed sequence.
        */
-      template<typename _Sseq, typename
-        = typename std::enable_if<std::is_class<_Sseq>::value
-                                 && !std::is_same<_Sseq, _RandomNumberEngine>
-                                 ::value>::type>
+      template<typename _Sseq, typename = typename
+       std::enable_if<!std::is_same<_Sseq, independent_bits_engine>::value
+                      && !std::is_same<_Sseq, _RandomNumberEngine>::value>
+               ::type>
         explicit
         independent_bits_engine(_Sseq& __q)
         : _M_b(__q)
@@ -1001,11 +1000,10 @@ namespace std
        *        seed sequence.
        * @param __q A seed generator function.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
+      template<typename _Sseq>
         void
         seed(_Sseq& __q)
-        { _M_b.seed<_Sseq>(__q); }
+        { _M_b.seed(__q); }
 
       /**
        * @brief Gets a const reference to the underlying generator engine
@@ -1178,10 +1176,10 @@ namespace std
        *
        * @param __q A seed sequence.
        */
-      template<typename _Sseq, typename
-        = typename std::enable_if<std::is_class<_Sseq>::value
-                                 && !std::is_same<_Sseq, _RandomNumberEngine>
-                                 ::value>::type>
+      template<typename _Sseq, typename = typename
+       std::enable_if<!std::is_same<_Sseq, shuffle_order_engine>::value
+                      && !std::is_same<_Sseq, _RandomNumberEngine>::value>
+              ::type>
         explicit
         shuffle_order_engine(_Sseq& __q)
         : _M_b(__q)
@@ -1214,12 +1212,11 @@ namespace std
        *        sequence.
        * @param __q A seed generator function.
        */
-      template<typename _Sseq, typename
-              = typename std::enable_if<std::is_class<_Sseq>::value>::type>
+      template<typename _Sseq>
         void
         seed(_Sseq& __q)
         {
-         _M_b.seed<_Sseq>(__q);
+         _M_b.seed(__q);
          _M_initialize();
        }
 
index 080a1dad88d491481bc318a5215599183e7754f2..0a39c71e9510b3b00cbf1afd9c6f69e6e65ab536 100644 (file)
@@ -126,8 +126,8 @@ namespace std
    * Seeds the LCR engine with a value generated by @p __q.
    */
   template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
-    template<typename _Sseq, typename>
-      void
+    template<typename _Sseq>
+      typename std::enable_if<std::is_class<_Sseq>::value>::type
       linear_congruential_engine<_UIntType, __a, __c, __m>::
       seed(_Sseq& __q)
       {
@@ -344,8 +344,8 @@ namespace std
           _UIntType __a, size_t __u, _UIntType __d, size_t __s,
           _UIntType __b, size_t __t, _UIntType __c, size_t __l,
           _UIntType __f>
-    template<typename _Sseq, typename>
-      void
+    template<typename _Sseq>
+      typename std::enable_if<std::is_class<_Sseq>::value>::type
       mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d,
                              __s, __b, __t, __c, __l, __f>::
       seed(_Sseq& __q)
@@ -531,8 +531,8 @@ namespace std
     }
 
   template<typename _UIntType, size_t __w, size_t __s, size_t __r>
-    template<typename _Sseq, typename>
-      void
+    template<typename _Sseq>
+      typename std::enable_if<std::is_class<_Sseq>::value>::type
       subtract_with_carry_engine<_UIntType, __w, __s, __r>::
       seed(_Sseq& __q)
       {
index 6c8498e7b106125d5b5a7af6ea5c460b5d24fee4..ded2205b125c95a07669229249891319d44e6c8c 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
     base_engine;
 
index fabe17a2b5639767a559d0ee2ea83abbe08c3591..4f903e53052ad434ecf03d30b6cff3c209328cb1 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::subtract_with_carry_engine<unsigned long, 24, 10, 24>
     base_engine;
 
diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/cons/copy.cc
new file mode 100644 (file)
index 0000000..d244c76
--- /dev/null
@@ -0,0 +1,42 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <random>
+
+void
+test01()
+{
+  std::discard_block_engine
+    <
+      std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
+      389, 24
+    > e(1);
+
+  const auto f(e);
+  auto g(f);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 926bb2c24dbe83c82c07cffe49dbc27bd93c0938..0868f8f4a66190df98becf6b1b2d514e8cdcb439 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::discard_block_engine
     <
       std::subtract_with_carry_engine<unsigned long, 24, 10, 24>,
index 4cedeb85d39974f53ace182cac42ec9c89f2eae6..ae9f2b4ce15ae73f6c0eafbc14e5551c0cd8fd23 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   unsigned long seed = 2;
 
   std::discard_block_engine
index b66752c2b6e604a56a4a523cdee99abc34dcfbcd..edf40b08c6dffa7cfa094008af1e42350dbf411f 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   double seed = 2.0;
 
   std::discard_block_engine
index aa86b9afedc9da54d54cef499baf452c30e890ad..c1f841a463099b65a2ce47157b9808bb2aad89ad 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.1 class template discard_block_engine [rand.adapt.disc]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::seed_seq seq;
 
   std::discard_block_engine
index 2c8d88e4f26bc1788ea4581caf7be07a2bc87eb8..81d5d8f184119d5da010695c6444d6d63db32785 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
     base_engine;
 
index 1d2ede72c9b0d813d5f2a65cf203882f37159c7e..c5747b306d59d89b726d20ae7521bf78c01c1fc7 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>
     base_engine;
 
diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/cons/copy.cc
new file mode 100644 (file)
index 0000000..1e88b89
--- /dev/null
@@ -0,0 +1,43 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <random>
+
+void
+test01()
+{
+  std::independent_bits_engine
+    <
+      std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
+      48,
+      uint_fast64_t
+    > e(1);
+
+  const auto f(e);
+  auto g(f);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 7db0cf30ffc5afb3348515a3331a5e4b7607309e..781e7a9e206df60c97325cec70da4f2de30b5bbd 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::independent_bits_engine
     <
       std::subtract_with_carry_engine<uint_fast64_t, 48, 5, 12>,
index 9ad6164d963eeac009498533cd45935eccc98835..890045d8692de7817498fdd4139eb28ac0817548 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   unsigned long seed = 2;
 
   std::independent_bits_engine
index 3e8787730443473d3d1f5f47388304a925c5780c..973ddd4dc6a0d622fafa87b3f8658efc1878a553 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   double seed = 2.0;
 
   std::independent_bits_engine
index 724a324310ffa9ccbc4d7f96d967b5177a52fbf9..dcaed2d75b3bd769cdc1be5db70e9080d765120f 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.2 class template independent_bits_engine [rand.adapt.ibits]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::seed_seq seq;
 
   std::independent_bits_engine
diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/cons/copy.cc
new file mode 100644 (file)
index 0000000..06360aa
--- /dev/null
@@ -0,0 +1,38 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <random>
+
+void
+test01()
+{
+  std::linear_congruential_engine<unsigned long, 48271, 0, 2147483647> e(1);
+
+  const auto f(e);
+  auto g(f);  
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 75a2e42c56d1f4d811e08c662e2db4339e9a92bf..06d04775b8d80361b4f09bcb9a18aa26c563575b 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
index a8819598670ad3545305f50e37ddf739361d4236..1fa23dff2b08abf4061666ae794e20eba5c69a43 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
index 4ec39b5bd3a76d1b435a43718d4481f607e75757..d09d838247d8157497b1905ec269cc7e52e68843 100644 (file)
@@ -20,9 +20,6 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.1 class template linear_congruential_engine [rand.eng.lcong]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
 
 void
diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/cons/copy.cc
new file mode 100644 (file)
index 0000000..3da72cb
--- /dev/null
@@ -0,0 +1,45 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <random>
+
+void
+test01()
+{
+  typedef unsigned long value_type;
+
+  std::mersenne_twister_engine<
+    value_type, 32, 624, 397, 31,
+    0x9908b0dful, 11,
+    0xfffffffful, 7,
+    0x9d2c5680ul, 15,
+      0xefc60000ul, 18, 1812433253ul> e(1);
+
+  const auto f(e);
+  auto g(f);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 30634e1da30ae6b1bd32e4a09afcaabd019b16a2..be5716080cab7b115c07bc7ab07719465fa635a0 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
@@ -20,9 +20,6 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
 #include <testsuite_hooks.h>
 
index b37f97824961583f66fdb834307447b07d301922..cf24ffe13f6073ef55a877aca36a36a82ba2ca32 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
index d840772cd76a1a6447d237c1b04fc5414cd38acd..425e5be7dca2fc9b02be767d53f711a0b76954ad 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
index c2fb9131d3642446e57d1166c8176c6fe838d73c..aa98c9b9309c802cdfecab568fdad48bbf0b01e1 100644 (file)
@@ -20,9 +20,6 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.2 Class template mersenne_twister_engine [rand.eng.mers]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
 
 void
index c0087721079cd60b53cb4f8f0a1f87254e877b21..197f5f0de9ea48e156b03d7f701844fadfb384de 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::linear_congruential_engine
             <uint_fast32_t, 16807UL, 0UL, 2147483647UL> base_engine;
 
index caac982e53fe51fdfe29a2f732dfc19f912538d1..c05bc19659db27dc905ac17740a285c797e13190 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   typedef std::linear_congruential_engine
             <uint_fast32_t, 16807UL, 0UL, 2147483647UL> base_engine;
 
diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/cons/copy.cc
new file mode 100644 (file)
index 0000000..c589a4e
--- /dev/null
@@ -0,0 +1,42 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <random>
+
+void
+test01()
+{
+  std::shuffle_order_engine
+    <
+      std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>,
+      256
+    > e(1);
+
+  const auto f(e);
+  auto g(f);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 5d96933ef9fcedab40db7fd98ffef6615044685a..15a5c2d8fbdffdfbbdf3d9c9428b45f39c2150c9 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::shuffle_order_engine
     <
       std::linear_congruential_engine<uint_fast32_t,16807UL, 0UL, 2147483647UL>,
index f6827009c7d4ffa246f5f41e153d2f32d272aef2..b39d45a396a001a66a683b6bc585b2504214460a 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   unsigned long seed = 2;
 
   std::shuffle_order_engine
index 44ba08896c07671671a41f00fedc396a381a7656..c979e32b87176837edd1b65edb9c34f000e28cb2 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   double seed = 2.0;
 
   std::shuffle_order_engine
index b88d7ebb6b716a6141ac8e6eacdd0fed87cbc767..01ea91f1e8ecb03ae38c48953c439159949a91ff 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-12-07  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.4.3 class template shuffle_order_engine [rand.adapt.shuf]
-// 26.4.2.3 concept RandomNumberEngineAdaptor [rand.concept.adapt]
-
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::seed_seq seq;
 
   std::shuffle_order_engine
diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/copy.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/cons/copy.cc
new file mode 100644 (file)
index 0000000..21df0a0
--- /dev/null
@@ -0,0 +1,38 @@
+// { dg-options "-std=c++0x" }
+// { dg-require-cstdint "" }
+//
+// 2010-02-16  Paolo Carlini  <paolo.carlini@oracle.com>
+//
+// Copyright (C) 2010 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <random>
+
+void
+test01()
+{
+  std::subtract_with_carry_engine<unsigned long, 24, 10, 24> e(1);
+
+  const auto f(e);
+  auto g(f);
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
index 4311439b6e61775414972592f22052653e650dd2..1297747a536a59587876be3fd25fa0eb4c731c1d 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
@@ -20,9 +20,6 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.3 Class template subtract_with_carry_engine [rand.eng.sub]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
 #include <testsuite_hooks.h>
 
index 078392ccbd02a43c6acf44d36edc6391899d676e..95db25f4dd85897759d55471906c88a6165d33d7 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
@@ -24,7 +24,6 @@
 // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
 
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
index d86187060925461e9f7aef6fddcd3c7bfe4fa697..73f9cbe0fffc4ff99c69bbeb1fef7112f82b6f57 100644 (file)
@@ -3,7 +3,7 @@
 //
 // 2008-11-24  Edward M. Smith-Rowland <3dw4rd@verizon.net>
 //
-// Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2008, 2009, 2010 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
@@ -24,7 +24,6 @@
 // 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
 
 #include <random>
-#include <testsuite_hooks.h>
 
 void
 test01()
index 617c455dab6fd498b2a1ec2b6aab6273afbb66e2..3fc9991d7fe275f78a68d95bf6cd65206f3a745e 100644 (file)
@@ -20,9 +20,6 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// 26.4.3.3 Class template subtract_with_carry_engine [rand.eng.sub]
-// 26.4.2.2 Concept RandomNumberEngine [rand.concept.eng]
-
 #include <random>
 
 void