Bug 23401 - Failure to link code which has virtual destructor and static data
Failure to link code which has virtual destructor and static data
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-01-05 05:39 EST by Need Real Name
Modified: 2007-04-18 12:30 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-01-18 17:02:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2001-01-05 05:39:37 EST
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
   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 17:02:50 EST
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.