Bug 23401 - Failure to link code which has virtual destructor and static data
Summary: Failure to link code which has virtual destructor and static data
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-01-05 10:39 UTC by Need Real Name
Modified: 2007-04-18 16:30 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-18 22:02:54 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)

Description Need Real Name 2001-01-05 10:39:37 UTC
The following code chunk demonstrates the problem. This code will not
link under 2.96.69 of gcc. It works fine under 2.95 (linux 6.1)

class fred
{
public:
   fred(){};
   virtual ~fred() {};
   void func() { static fred tmp; };
};

int main(int argc, char *argv[])
{
   fred f;
   return 0;
}

It seems to be the combination of a virtual destructor and the static data
in func which causes it.

Comment 1 Jakub Jelinek 2001-01-18 22:02:50 UTC
Actually, the virtual has no effect here.
Should be fixed in gcc-c++-2.96-71.


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