Bug 23417 - bits/stl_tree.h isn't -Weffc++ clean
Summary: bits/stl_tree.h isn't -Weffc++ clean
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.0.2
: P2 normal
Target Milestone: 4.0.2
Assignee: Benjamin Kosnik
URL:
Keywords:
Depends on:
Blocks: 12854
  Show dependency treegraph
 
Reported: 2005-08-16 07:51 UTC by Debian GCC Maintainers
Modified: 2005-09-12 20:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2005-08-16 07:51:47 UTC
[forwarded from http://bugs.debian.org/]

gcc version 4.0.2 20050806

Warning is "_M_header should be initialized in the member intialization
list". Ok, patch follows:

--- /usr/include/c++/4.0.1/bits/stl_tree.h~     2005-07-12 06:15:28.000000000 +0200
+++ /usr/include/c++/4.0.1/bits/stl_tree.h      2005-08-09 15:43:32.000000000 +0200
@@ -401,7 +401,7 @@

          _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
                        const _Key_compare& __comp = _Key_compare())
-         : _Node_allocator(__a), _M_key_compare(__comp), _M_node_count(0)
+         : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
_M_node_count(0)
          {
            this->_M_header._M_color = _S_red;
            this->_M_header._M_parent = 0;
Comment 1 Chris Jefferson 2005-08-16 09:10:47 UTC
In the FAQ (4.4), things that only looks like bugs, mentions that libstdc++ isn't -Weffc++ clean.
Comment 2 Andrew Pinski 2005-08-16 12:02:49 UTC
(In reply to comment #1)
> In the FAQ (4.4), things that only looks like bugs, mentions that libstdc++ isn't -Weffc++ clean.

And more than that, there is a bug in that database which is suspended for libstdc++ vs -Weffc++, 
PR 12854.
Comment 3 Andrew Pinski 2005-08-17 02:36:51 UTC
Having a testcase to reproduce this would be nice.
Comment 4 Benjamin Kosnik 2005-09-12 19:20:59 UTC
Reproducer, compile with -Weffc++.

#include <list>
std::list<int> l;

...fixing....
Comment 5 GCC Commits 2005-09-12 19:48:21 UTC
Subject: Bug 23417

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bkoz@gcc.gnu.org	2005-09-12 19:48:05

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_list.h 

Log message:
	2005-09-12  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/23417
	* include/bits/stl_list.h (_List_impl): Use member initialization
	list for -Weffc++.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3097&r2=1.3098
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&r1=1.52&r2=1.53

Comment 6 GCC Commits 2005-09-12 19:55:37 UTC
Subject: Bug 23417

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	bkoz@gcc.gnu.org	2005-09-12 19:54:56

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_list.h 

Log message:
	2005-09-12  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/23417
	* include/bits/stl_list.h (_List_impl): Use member initialization
	list for -Weffc++.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2917.2.80&r2=1.2917.2.81
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_list.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.47.6.1&r2=1.47.6.2

Comment 7 Paolo Carlini 2005-09-12 19:59:34 UTC
Benjamin, can you also check, say, std::set? After all the PR is about
stl_tree.h... ;)
Comment 8 Benjamin Kosnik 2005-09-12 20:05:28 UTC
Yep. Sorry. I fixed that bit too.

-benjamin
Comment 9 GCC Commits 2005-09-12 20:09:43 UTC
Subject: Bug 23417

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	bkoz@gcc.gnu.org	2005-09-12 20:09:18

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_tree.h 

Log message:
	2005-09-12  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/23417
	* include/bits/stl_list.h (_List_impl): Use member initialization
	list for -Weffc++.
	* include/bits/stl_tree.h (_Rb_tree_impl): Same.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.2917.2.81&r2=1.2917.2.82
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.44.6.2&r2=1.44.6.3

Comment 10 GCC Commits 2005-09-12 20:33:05 UTC
Subject: Bug 23417

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bkoz@gcc.gnu.org	2005-09-12 20:32:54

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_tree.h 

Log message:
	2005-09-12  Benjamin Kosnik  <bkoz@redhat.com>
	
	PR libstdc++/23417
	* include/bits/stl_list.h (_List_impl): Use member initialization
	list for -Weffc++.
	* include/bits/stl_tree.h (_Rb_tree_impl): Same.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3098&r2=1.3099
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&r1=1.48&r2=1.49

Comment 11 Benjamin Kosnik 2005-09-12 20:51:47 UTC
Fixed.
Comment 12 GCC Commits 2005-09-18 13:39:36 UTC
Subject: Bug 23417

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2005-09-18 13:39:26

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: stl_tree.h 

Log message:
	2005-09-18  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/23417 (cont)
	* include/bits/stl_tree.h (_Rb_tree_impl<true>): Use member
	initialization list for -Weffc++.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.3109&r2=1.3110
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_tree.h.diff?cvsroot=gcc&r1=1.49&r2=1.50