This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/46626] [4.6 Regression] simple use of virtual methods causes pure virtual method call in c++0x mode


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]