public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode
Date: Thu, 23 Dec 2010 12:35:00 -0000	[thread overview]
Message-ID: <bug-46626-4-9V1pOY2gt8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-46626-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-23 12:34:40 UTC ---
Created attachment 22846
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22846
gcc46-pr46626.patch

Untested fix.  The problem seems to be that the B::B() ctor body, which is
constexpr (and g++ generated) has a CLEANUP_STMT in it, and
build_data_member_initialization ignores CLEANUP_STMT, which means the setting
of vtable pointer to _ZTV1B + 16 is ignored, thus it stays to be _ZTV1A + 16.

The attached patch handles CLEANUP_BODY of CLEANUP_STMT by recursing into it.


  parent reply	other threads:[~2010-12-23 12:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 19:10 [Bug c++/46626] New: " zsojka at seznam dot cz
2010-11-23 20:01 ` [Bug c++/46626] " redi at gcc dot gnu.org
2010-11-23 20:07 ` hjl.tools at gmail dot com
2010-11-23 20:21 ` hjl.tools at gmail dot com
2010-11-24 12:04 ` rguenth at gcc dot gnu.org
2010-12-08  0:43 ` zsojka at seznam dot cz
2010-12-08  2:07 ` redi at gcc dot gnu.org
2010-12-08 12:40 ` zsojka at seznam dot cz
2010-12-23 12:35 ` jakub at gcc dot gnu.org [this message]
2010-12-25  1:49 ` roman at binarylife dot net
2010-12-27 12:54 ` jakub at gcc dot gnu.org
2010-12-27 13:15 ` jakub at gcc dot gnu.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-46626-4-9V1pOY2gt8@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).