From cbd8cc2500741da3f8a6988169ad173d7f251f01 Mon Sep 17 00:00:00 2001
From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Fri, 18 Jun 2004 17:13:35 +0000
Subject: [PATCH] 2004-06-18  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/16020
	* include/debug/safe_base.h
	(_Safe_sequence_base::_Safe_sequence_base(const _Safe_sequence_base&),
	_Safe_sequence_base::operator=): Provide definitions.
	* testsuite/23_containers/bitset/cons/16020.cc: New.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83357 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libstdc++-v3/ChangeLog                        |  8 ++++
 libstdc++-v3/include/debug/safe_base.h        | 17 +++++++-
 .../23_containers/bitset/cons/16020.cc        | 42 +++++++++++++++++++
 3 files changed, 65 insertions(+), 2 deletions(-)
 create mode 100644 libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc

diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 4561e9e27a98..bd7da02e485a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2004-06-18  Paolo Carlini  <pcarlini@suse.de>
+
+	PR libstdc++/16020
+	* include/debug/safe_base.h
+	(_Safe_sequence_base::_Safe_sequence_base(const _Safe_sequence_base&),
+	_Safe_sequence_base::operator=): Provide definitions.
+	* testsuite/23_containers/bitset/cons/16020.cc: New.
+
 2004-06-18  Benjamin Kosnik  <bkoz@redhat.com>
 
 	* include/ext/pool_allocator.h: Qualify __throw_bad_alloc.
diff --git a/libstdc++-v3/include/debug/safe_base.h b/libstdc++-v3/include/debug/safe_base.h
index 10f9ec725469..fb62620f06a2 100644
--- a/libstdc++-v3/include/debug/safe_base.h
+++ b/libstdc++-v3/include/debug/safe_base.h
@@ -165,10 +165,23 @@ namespace __gnu_debug
     { }
 
     explicit
-    _Safe_sequence_base(const _Safe_sequence_base&);
+    _Safe_sequence_base(const _Safe_sequence_base& __seq)
+    : _M_iterators(__seq._M_iterators),
+      _M_const_iterators(__seq._M_const_iterators),
+      _M_version(__seq._M_version)
+    { }
 
     _Safe_sequence_base&
-    operator=(const _Safe_sequence_base&);
+    operator=(const _Safe_sequence_base& __seq)
+    {
+      if (&__seq != this)
+	{
+	  _M_iterators = __seq._M_iterators;
+	  _M_const_iterators = __seq._M_const_iterators;
+	  _M_version = __seq._M_version;
+	}
+      return *this;
+    }
 
     /** Notify all iterators that reference this sequence that the
 	sequence is being destroyed. */
diff --git a/libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc b/libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc
new file mode 100644
index 000000000000..dbf1797572cd
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc
@@ -0,0 +1,42 @@
+// Copyright (C) 2004 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <debug/bitset>
+#include <testsuite_hooks.h>
+
+// libstdc++/16020
+void test01()
+{
+  using __gnu_debug::bitset;
+  bool test __attribute__((unused)) = true;
+
+  bitset<5> b(7);
+  bitset<5> c;
+
+  bitset<5> bb(b);
+  c = bb;
+
+  VERIFY( bb == b );
+  VERIFY( c == bb );
+}
+
+int main()
+{
+  test01();
+  return 0;
+}
-- 
GitLab