User account creation filtered due to spam.

Bug 16020 - [3.4 regression] cannot copy __gnu_debug::bitset
Summary: [3.4 regression] cannot copy __gnu_debug::bitset
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 3.4.1
Assignee: Paolo Carlini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-16 12:12 UTC by Jonathan Wakely
Modified: 2004-06-18 21:57 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-06-16 14:03:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2004-06-16 12:12:11 UTC
This is a FAIL when running the libstdc++ testsuite with -D_GLIBCXX_DEBUG.

testsuite/23_containers/bitset/operations/1.cc fails to link because
bitset inherits from _Safe_sequence_base, which has protected but
undefined copy ctor and op=, due to this change:

2004-05-22  Benjamin Kosnik  <bkoz@redhat.com>

        PR libstdc++/12854
        Fixups for -Weffc++.
[snip]
        * include/debug/safe_base.h (_Safe_sequence_base): Declare copy
        constructor and assignment operator protected.
        (_Safe_iterator_base): Same.
        * include/debug/formatter.h (_Error_formatter): Define copy
        constructor and assignment operator.

Simplified, the test case is:

    #define _GLIBCXX_DEBUG
    #include <bitset>
    int main()
    {
        std::bitset<5> b;
        std::bitset<5> bb(b);
        b = bb;
    }

This gets undefined references with recent CVS builds of 3.4 or 3.5

My copies of the standard are packed away so I can't check whether bitset
should be copy constructible and assignable.

Dinkumware's docs and the last public draft standard seem to say no (are
the copy ctor and op= implied?) while SGI's docs, the v3 sources and
Comeau say yes (which is good enough for me).

So I think we should define those members for _Safe_sequence_base.
Comment 1 Wolfgang Bangerth 2004-06-16 14:03:21 UTC
Confirmed. 
Comment 2 Benjamin Kosnik 2004-06-18 16:39:06 UTC
> (are the copy ctor and op= implied?) 

Yes, unless explicitly denied.

-benjamin
Comment 3 CVS Commits 2004-06-18 17:13:50 UTC
Subject: Bug 16020

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2004-06-18 17:13:36

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/debug: safe_base.h 
Added files:
	libstdc++-v3/testsuite/23_containers/bitset/cons: 16020.cc 

Log message:
	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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2523&r2=1.2524
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/debug/safe_base.h.diff?cvsroot=gcc&r1=1.3&r2=1.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 CVS Commits 2004-06-18 21:56:20 UTC
Subject: Bug 16020

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	paolo@gcc.gnu.org	2004-06-18 21:56:14

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/debug: safe_base.h 
Added files:
	libstdc++-v3/testsuite/23_containers/bitset/cons: 16020.cc 

Log message:
	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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.127&r2=1.2224.2.128
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/debug/safe_base.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2.8.1&r2=1.2.8.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1

Comment 5 Paolo Carlini 2004-06-18 21:57:07 UTC
Fixed for 3.4.1.