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
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL:
Whiteboard:
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:
Clone Of:
Environment:
Last Closed: 2001-01-18 22:02:54 UTC
Embargoed:


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.