Bug 59766 - g++ wrong virtual function in template base class destructor
g++ wrong virtual function in template base class destructor
Status: CLOSED ERRATA
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-02-12 17:08 EST by Jim Rees
Modified: 2007-04-18 12:40 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-07-26 17:47:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
reproducer program (1.49 KB, text/plain)
2002-02-12 17:09 EST, Jim Rees
no flags Details

  None (edit)
Description Jim Rees 2002-02-12 17:08:11 EST
From Bugzilla Helper:

User-Agent: Mozilla/4.0 (compatible; MSIE 5.12; Mac_PowerPC)



Description of problem:

In the case of a base class which is an instance of a template, if its 
destructor invokes a virtual member function which was overridden by a 
more derived class, that override is invoked instead of the base class's 
own member function.   This violates the C++ standard (12.7.3).   This 
bug appears to be specific to the 2.96-series of RedHat compilers.



Version-Release number of selected component (if applicable):





How reproducible:

Always



Steps to Reproduce:

Compile and run the attached C++ program.



Actual Results:  The string "DerivedClass Close() invoked, BROKEN!" is 
printed.



Expected Results:  The string "BaseClass Close() invoked, CORRECT!" 
should be printed.



Additional info:



The bug is not present in RH6.2, is present in 7.1, and 7.2.  7.0 not tested.
Comment 1 Jim Rees 2002-02-12 17:09:55 EST
Created attachment 45440 [details]
reproducer program
Comment 2 Jakub Jelinek 2002-02-14 18:12:20 EST
gcc 3.0-3.0.2 had the same bug, fixed by Jason Merrill in December last year.
Should be fixed in gcc-2.96-103, currently at
ftp://people.redhat.com/jakub/gcc/2.96-103/
Comment 3 Bill Nottingham 2002-07-26 17:47:28 EDT
An errata has been issued which should help the problem described in this bug report. 
This report is therefore being closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, please follow the link below. You may reopen 
this bug report if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2002-055.html

Note You need to log in before you can comment on or make changes to this bug.