Bug 56861

Summary: destructors of static members in template class do not get called
Product: [Retired] Red Hat Linux Reporter: Aaron Lunansky <lunansky>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: high Docs Contact:
Priority: high    
Version: 7.1CC: shishz, zulic
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-15 18:35:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test case demonstrating bug none

Description Aaron Lunansky 2001-11-29 01:40:25 UTC
Description of Problem:

The destructor of static members in a template class are not called. 

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

gcc 2.96-81, gcc 2.96-99

How Reproducible:

100%

Steps to Reproduce:
1. $ g++ -O0 destructor_test.cpp -o destructor_test
2. $ ./destructor_test

Actual Results:

Simple()

Expected Results:

Simple()
~Simple()

Additional Information:

Does not occur with gcc 3.01 or gcc 2.95.2 on the same system.

puffin) 17:32:26 test $ rpm -qa | grep glibc
compat-glibc-6.2-2.1.3.2
glibc-2.2.2-10
glibc-common-2.2.2-10
glibc-devel-2.2.2-10
glibc-profile-2.2.2-10

Fails with binutils shipped with 7.1 as well as binutils2.11.92.05

Comment 1 Aaron Lunansky 2001-11-29 01:41:58 UTC
Created attachment 39006 [details]
Test case demonstrating bug

Comment 2 Alan Cox 2002-12-15 18:35:55 UTC
Ok in g++ 3.2