public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/5645] gcc warns that pure virtual class not explicitly initialized Date: Wed, 17 Oct 2007 11:26:00 -0000 [thread overview] Message-ID: <20071017112612.4244.qmail@sourceware.org> (raw) In-Reply-To: <bug-5645-2936@http.gcc.gnu.org/bugzilla/> ------- Comment #4 from manu at gcc dot gnu dot org 2007-10-17 11:26 ------- Does this patch makes any sense? This needs testcases (suggestions for extra testcases are welcome), Changelog, bootstrap + testing and proper submission. --- init.c 2007-09-20 15:13:00.000000000 +0100 +++ init.c.fixed 2007-10-17 12:20:24.000000000 +0100 @@ -684,10 +684,11 @@ emit_mem_initializers (tree mem_inits) /* If these initializations are taking place in a copy constructor, the base class should probably be explicitly - initialized. */ + initialized unless it is nearly empty. */ if (extra_warnings && !arguments && DECL_COPY_CONSTRUCTOR_P (current_function_decl) - && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject))) + && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)) + && !CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (subobject)) warning (OPT_Wextra, "%Jbase class %q#T should be explicitly initialized in the " "copy constructor", current_function_decl, BINFO_TYPE (subobject)); -- manu at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2005-12-11 21:53:55 |2007-10-17 11:26:12 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=5645
next prev parent reply other threads:[~2007-10-17 11:26 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-5645-2936@http.gcc.gnu.org/bugzilla/> 2007-02-09 14:02 ` manu at gcc dot gnu dot org 2007-10-17 11:26 ` manu at gcc dot gnu dot org [this message] 2007-10-18 9:43 ` nathan at codesourcery dot com 2007-10-30 3:46 ` patchapp at dberlin dot org 2007-11-14 13:38 ` jwakely dot gcc at gmail dot com 2008-02-13 11:13 ` manu at gcc dot gnu dot org 2008-02-13 11:24 ` manu at gcc dot gnu dot org 2008-02-13 11:38 ` manu at gcc dot gnu dot org 2008-02-14 23:12 ` jason at gcc dot gnu dot org 2008-02-14 23:39 ` manu at gcc dot gnu dot org [not found] <20020209123600.5645.tom@wact.net> 2003-08-27 14:48 ` bangerth at dealii dot org 2003-08-28 14:49 ` pinskia at gcc dot gnu dot org 2005-06-20 4:06 ` 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=20071017112612.4244.qmail@sourceware.org \ --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: linkBe 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).