public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/19808] miss a warning about uninitialized members in constructor
Date: Mon, 29 Sep 2014 13:06:00 -0000	[thread overview]
Message-ID: <bug-19808-4-PhaVKsNvNd@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-19808-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19808

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #22 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #21)
> I just got hit by this bug. This can obviously be warned in the FE as clang
> does:
> 
> test.cc:4:11: warning: field 'j' is uninitialized when used here
> [-Wuninitialized]
>   S() : i(j), j(1) {} 
>           ^
> 
> simply by marking the members somehow as initialized or not, and when using
> them realizing that they are still uninitialized.
> 
> Marek, Paolo, Jason? Any idea how to do this?

It could be done specifically for uses in mem-initializers by walking the
initializer in perform_mem_init to look for any references to members that
haven't been marked yet.

A more general warning that would cover, say,

X x;
x.x = x.y;

would need support in the existing back end -Wuninitialized code.
>From gcc-bugs-return-462847-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Sep 29 13:10:42 2014
Return-Path: <gcc-bugs-return-462847-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10432 invoked by alias); 29 Sep 2014 13:10:41 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 10388 invoked by uid 48); 29 Sep 2014 13:10:37 -0000
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/62164] 5.0: ICE: error: Both section and comdat group is set
Date: Mon, 29 Sep 2014 13:10:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jason at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-62164-4-NcAuFghIsH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-62164-4@http.gcc.gnu.org/bugzilla/>
References: <bug-62164-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-09/txt/msg02681.txt.bz2
Content-length: 807

https://gcc.gnu.org/bugzilla/show_bug.cgi?idb164

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #2)
> The sections for COMDAT functions are used to drive code unification.  I
> wonder, do we want to support something like this (and expect that user
> knows what he is doing and he won't, for example, drop multiple COMDATs into
> one section) or just reject the attribute?

What's wrong with dropping multiple COMDATs into one section?  Don't we
normally stick lots of COMDATs into .text?


  parent reply	other threads:[~2014-09-29 13:06 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-19808-4@http.gcc.gnu.org/bugzilla/>
2013-07-17  9:26 ` redi at gcc dot gnu.org
2014-09-27 20:29 ` manu at gcc dot gnu.org
2014-09-29 13:06 ` jason at gcc dot gnu.org [this message]
2014-09-29 14:35 ` manu at gcc dot gnu.org
2014-11-15 23:11 ` [Bug c++/19808] miss a warning about uninitialized member usage in member initializer list " anthony.brandon at gmail dot com
2014-11-16 19:14 ` anthony.brandon at gmail dot com
2020-10-21 23:28 ` mpolacek at gcc dot gnu.org
2020-11-12 15:07 ` mpolacek at gcc dot gnu.org
2020-11-13  3:07 ` mpolacek at gcc dot gnu.org
2021-11-05 23:33 ` mpolacek at gcc dot gnu.org
2021-11-19  3:38 ` cvs-commit at gcc dot gnu.org
2021-11-19  3:54 ` mpolacek at gcc dot gnu.org
2021-11-19  9:09 ` dcb314 at hotmail dot com
2021-11-19 11:00 ` dcb314 at hotmail dot com
2021-11-19 11:09 ` redi at gcc dot gnu.org
2021-11-19 16:57 ` mpolacek at gcc dot gnu.org
2021-11-23 20:02 ` cvs-commit at gcc dot gnu.org
     [not found] <bug-19808-5329@http.gcc.gnu.org/bugzilla/>
2006-02-02 12:58 ` [Bug c++/19808] miss a warning about uninitialized members " pinskia at gcc dot gnu dot org
2007-12-04 21:04 ` myselfhimself at free dot fr
2008-07-21 14:31 ` manu at gcc dot gnu dot org
2010-02-24 12:46 ` manu at gcc dot gnu dot org
2010-02-24 12:59 ` manu at gcc dot gnu dot org
2010-02-24 16:44 ` jason at gcc dot gnu dot org
2010-02-24 18:04 ` rguenth at gcc dot gnu dot org
2010-02-24 19:10 ` bart dot vanassche at gmail dot com
2010-02-24 19:45 ` manu at gcc dot gnu dot org
2010-02-24 20:13 ` jason at gcc dot gnu dot org
2010-02-24 20:15 ` manu at gcc dot gnu dot org
2010-02-24 20:22 ` rguenth at gcc dot gnu dot org
2010-02-24 20:30 ` manu at gcc dot gnu dot org
2010-02-24 20:44 ` jason at gcc dot gnu dot org
2010-02-24 20:45 ` jason at gcc dot gnu dot org
2010-02-25  7:01 ` bart dot vanassche at gmail dot com
2010-02-25  7:06 ` bart dot vanassche at gmail dot com
2005-02-07 23:16 [Bug c++/19808] New: " adl at gnu dot org
2005-02-08  9:35 ` [Bug c++/19808] " bangerth at dealii dot org
2005-02-08  9:59 ` pinskia at gcc dot gnu 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-19808-4-PhaVKsNvNd@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).