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

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).