Bug 59766 - g++ wrong virtual function in template base class destructor
Summary: g++ wrong virtual function in template base class destructor
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
(Show other bugs)
Version: 7.2
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-12 22:08 UTC by Jim Rees
Modified: 2007-04-18 16:40 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-07-26 21:47:27 UTC
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 22:09 UTC, Jim Rees
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2002:055 contract SHIPPED_LIVE Updated version of GCC 2.96-RH now available 2002-04-02 05:00:00 UTC

Description Jim Rees 2002-02-12 22:08:11 UTC
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 22:09:55 UTC
Created attachment 45440 [details]
reproducer program

Comment 2 Jakub Jelinek 2002-02-14 23:12:20 UTC
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 21:47:28 UTC
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.