public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/18016] Warn about member variables initialized with itself
Date: Tue, 21 Dec 2010 17:20:00 -0000	[thread overview]
Message-ID: <bug-18016-4-lXZ9xaZMX5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-18016-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-12-21 17:19:57 UTC ---
my patch doesn't help in these cases (which clang does warn about):
A() : a(this->a) { }
A() : a((int)a) { }
A() : a(a+1) { }
For that we need proper tracking of uninitialized variables, which we don't do
for member variables.  But my patch catches the simple typo where you
accidentally use the wrong variable name in a mem-initializer.


  parent reply	other threads:[~2010-12-21 17:20 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-18016-4@http.gcc.gnu.org/bugzilla/>
2010-12-16 16:05 ` redi at gcc dot gnu.org
2010-12-21 15:28 ` redi at gcc dot gnu.org
2010-12-21 17:20 ` redi at gcc dot gnu.org [this message]
2010-12-22  9:18 ` manu at gcc dot gnu.org
2010-12-22 14:40 ` redi at gcc dot gnu.org
2011-05-23  8:39 ` redi at gcc dot gnu.org
2011-05-23  8:52 ` redi at gcc dot gnu.org
2011-06-27 18:07 ` ejb at ql dot org
2011-12-13 19:59 ` redi at gcc dot gnu.org
2012-11-14 11:41 ` redi at gcc dot gnu.org
     [not found] <bug-18016-4042@http.gcc.gnu.org/bugzilla/>
2007-04-27 15:45 ` irving at cs dot stanford dot edu
2010-02-21 19:17 ` manu at gcc dot gnu dot org
2004-10-15 16:45 [Bug c++/18016] New: -Winit-self misses member variables initialized after : in ctor ejb at ql dot org
2004-10-15 17:05 ` [Bug c++/18016] Warn about member variables initialized with itself pinskia at gcc dot gnu dot org
2004-10-28  3:35 ` giovannibajo at libero dot it
2004-10-28 13:08 ` bangerth at dealii dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-18016-4-lXZ9xaZMX5@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).