This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Dec 2010 12:35:01 +0000
- Subject: [Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode
- Auto-submitted: auto-generated
- References: <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.