commit 8009da43b7be1a10335240b7b2f4e27250d5376f
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon Mar 30 19:22:52 2015 +0100
PR libstdc++/65631
* include/bits/random.h (seed_seq) Define copy constructor and copy
assignment as deleted.
* testsuite/26_numerics/random/seed_seq/cons/65631.cc: New.
@@ -6053,6 +6053,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
param(OutputIterator __dest) const
{ std::copy(_M_v.begin(), _M_v.end(), __dest); }
+ // no copy functions
+ seed_seq(const seed_seq&) = delete;
+ seed_seq& operator=(const seed_seq&) = delete;
+
private:
///
std::vector<result_type> _M_v;
new file mode 100644
@@ -0,0 +1,28 @@
+// Copyright (C) 2015 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/>.
+
+// { dg-options "-std=gnu++11" }
+// { dg-do compile }
+
+#include <random>
+#include <type_traits>
+
+static_assert( !std::is_copy_constructible<std::seed_seq>::value,
+ "seed_seq is not copy constructible" );
+
+static_assert( !std::is_copy_assignable<std::seed_seq>::value,
+ "seed_seq is not copy assignable" );