public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58297] New: wrong DTOR call is generated when virtual base is present
@ 2013-09-02 11:28 kcc at gcc dot gnu.org
  2013-09-02 11:37 ` [Bug c++/58297] " paolo.carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: kcc at gcc dot gnu.org @ 2013-09-02 11:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58297
           Summary: wrong DTOR call is generated when virtual base is
                    present
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kcc at gcc dot gnu.org

For some reason, g++ (r202164) generates a call to an incorrect DTOR, 
but never generates the DTOR itself. As the result, we get this link error:
   undefined reference to `BBB::~BBB(void const**)'

The test case is reduced from Chromium sources, 
https://code.google.com/p/chromium/issues/detail?id=282285

% head z.h z1.cc z2.cc
==> z.h <==
struct AAA { };
struct BBB: virtual AAA { ~BBB (); };

==> z1.cc <==
#include "z.h"
BBB::~BBB() { }
int main() { }

==> z2.cc <==
#include "z.h"
struct CCC: BBB {   ~CCC (); };
CCC::~CCC () { }
% 

% g++ z1.cc z2.cc  # 4.6.3
% clang++ z1.cc z2.cc  # fresh trunk
% $FRESH_GCC/bin/g++ z1.cc z2.cc 
/tmp/ccO8JGGF.o: In function `CCC::~CCC()':
z2.cc:(.text+0x31): undefined reference to `BBB::~BBB(void const**)'
/tmp/ccO8JGGF.o: In function `CCC::~CCC()':
z2.cc:(.text+0x6a): undefined reference to `BBB::~BBB(void const**)'
collect2: error: ld returned 1 exit status


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/58297] wrong DTOR call is generated when virtual base is present
  2013-09-02 11:28 [Bug c++/58297] New: wrong DTOR call is generated when virtual base is present kcc at gcc dot gnu.org
@ 2013-09-02 11:37 ` paolo.carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-09-02 11:37 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Dup.

*** This bug has been marked as a duplicate of bug 58201 ***


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-09-02 11:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-02 11:28 [Bug c++/58297] New: wrong DTOR call is generated when virtual base is present kcc at gcc dot gnu.org
2013-09-02 11:37 ` [Bug c++/58297] " paolo.carlini at oracle dot com

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).