Bug 23401

Summary: Failure to link code which has virtual destructor and static data
Product: [Retired] Red Hat Linux Reporter: Need Real Name <swir>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
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: 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: --- Target Upstream Version:
Embargoed:

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.