public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor
@ 2003-07-16 23:32 bangerth at dealii dot org
  2003-07-16 23:41 ` [Bug c++/11554] [3.3/3.4 Regression] " pinskia at physics dot uc dot edu
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2003-07-16 23:32 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554

           Summary: Warning about reordering of initializers doesn't mention
                    location of constructor
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org,gdr at gcc dot gnu dot
                    org

When one accidentally orders initializers of member variables in another
order than the one they appear in the class declaration, one gets a
warning about this. However, this warning doesn't state where the
problem is:
------------------------------------
struct Y {
    Y ();
    int i1, i2;
};

Y::Y () : i2(0), i1(0) {}
------------------------------------
parameter-estimation/me-uncertainty> c++ -Wall -c x.cc
x.cc: In constructor `Y::Y()':
x.cc:3: warning: `Y::i2' will be initialized after
x.cc:3: warning:   `int Y::i1'

So this gives the location where i1 and i2 are _declared_, but it doesn't
show where the problem really is, namely in the _definition_ of the
constructor, or more exactly: in its member initializer list, which would
be in line 6. This can become a little confusing if one has a class with
more than one constructor.

W.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
@ 2003-07-16 23:41 ` pinskia at physics dot uc dot edu
  2003-08-05  5:15 ` pinskia at physics dot uc dot edu
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-07-16 23:41 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-16 23:41:51
               date|                            |
            Summary|Warning about reordering of |[3.3/3.4 Regression] Warning
                   |initializers doesn't mention|about reordering of
                   |location of constructor     |initializers doesn't mention
                   |                            |location of constructor
   Target Milestone|3.4                         |3.3.2


------- Additional Comments From pinskia at physics dot uc dot edu  2003-07-16 23:41 -------
I can confirm this on 3.3.1 (20030707) and the mainline (20030716), but on 3.2.3, gcc gives the 
line number:
pr11554.cc: In constructor `Y::Y()':
pr11554.cc:3: warning: member initializers for `int Y::i2'
pr11554.cc:3: warning:   and `int Y::i1'
pr11554.cc:6: warning:   will be re-ordered to match declaration order
I do not know why this was changed.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
  2003-07-16 23:41 ` [Bug c++/11554] [3.3/3.4 Regression] " pinskia at physics dot uc dot edu
@ 2003-08-05  5:15 ` pinskia at physics dot uc dot edu
  2003-10-16  9:22 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-08-05  5:15 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mark at codesourcery dot com


------- Additional Comments From pinskia at physics dot uc dot edu  2003-08-05 05:15 -------
I found the history of why this change, it was changed to fix an ICE on valid code, PR 
7188.
Mark your patch which fixed that PR also removed the location of inititalizers, did you 
mean to do that?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
  2003-07-16 23:41 ` [Bug c++/11554] [3.3/3.4 Regression] " pinskia at physics dot uc dot edu
  2003-08-05  5:15 ` pinskia at physics dot uc dot edu
@ 2003-10-16  9:22 ` mmitchel at gcc dot gnu dot org
  2003-12-21 20:51 ` gdr at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-10-16  9:22 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.3.2                       |3.3.3


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-10-16 09:22 -------
Postponed until GCC 3.3.3.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2003-10-16  9:22 ` mmitchel at gcc dot gnu dot org
@ 2003-12-21 20:51 ` gdr at gcc dot gnu dot org
  2003-12-22  6:18 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gdr at gcc dot gnu dot org @ 2003-12-21 20:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From gdr at gcc dot gnu dot org  2003-12-21 20:45 -------
Mark --
Do you have plan for this regression?

-- Gaby


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2003-12-21 20:51 ` gdr at gcc dot gnu dot org
@ 2003-12-22  6:18 ` cvs-commit at gcc dot gnu dot org
  2003-12-22  8:03 ` cvs-commit at gcc dot gnu dot org
  2003-12-22  8:04 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-22  6:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-22 06:07 -------
Subject: Bug 11554

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-12-22 06:07:02

Modified files:
	gcc/cp         : ChangeLog init.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: ctor-init-1.C 

Log message:
	PR c++/11554
	* init.c (sort_mem_initializers): Add warning.
	
	PR c++/11554
	* testsuite/g++.dg/warn/ctor-init-1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3826&r2=1.3827
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.353&r2=1.354
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3294&r2=1.3295
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/ctor-init-1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2003-12-22  6:18 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-22  8:03 ` cvs-commit at gcc dot gnu dot org
  2003-12-22  8:04 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-12-22  8:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-12-22 06:14 -------
Subject: Bug 11554

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	mmitchel@gcc.gnu.org	2003-12-22 06:14:43

Modified files:
	gcc/cp         : ChangeLog init.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/warn: ctor-init-1.C 

Log message:
	PR c++/11554
	* init.c (sort_mem_initializers): Add warning.
	
	PR c++/11554
	* testsuite/g++.dg/warn/ctor-init-1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.225&r2=1.3076.2.226
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.299.2.11&r2=1.299.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.341&r2=1.2261.2.342
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/ctor-init-1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/11554] [3.3/3.4 Regression] Warning about reordering of initializers doesn't mention location of constructor
  2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
                   ` (5 preceding siblings ...)
  2003-12-22  8:03 ` cvs-commit at gcc dot gnu dot org
@ 2003-12-22  8:04 ` mmitchel at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-12-22  8:04 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-12-22 06:15 -------
Fixed in GCC 3.3.3 and GCC 3.4.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11554


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-12-22  6:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-16 23:32 [Bug c++/11554] New: Warning about reordering of initializers doesn't mention location of constructor bangerth at dealii dot org
2003-07-16 23:41 ` [Bug c++/11554] [3.3/3.4 Regression] " pinskia at physics dot uc dot edu
2003-08-05  5:15 ` pinskia at physics dot uc dot edu
2003-10-16  9:22 ` mmitchel at gcc dot gnu dot org
2003-12-21 20:51 ` gdr at gcc dot gnu dot org
2003-12-22  6:18 ` cvs-commit at gcc dot gnu dot org
2003-12-22  8:03 ` cvs-commit at gcc dot gnu dot org
2003-12-22  8:04 ` mmitchel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).