Bug 56494 - code will not compile
Summary: code will not compile
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-20 00:09 UTC by Rich Graham
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-02 00:50:49 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 Rich Graham 2001-11-20 00:09:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.9-xfs i686)

Description of problem:
test code:
#include <stdio.h>

class A {
 public:
  A(){ printf(" hi from A() \n"); }
 ~A(){ printf(" hi from ~A() \n"); }
};

template < class T >  
class B {
 public:
  B(){ printf(" hi from B() \n"); }
 ~B(){ printf(" hi from ~B() \n"); C->A::~A();}
// ~B(){ printf(" hi from ~B() \n"); C->~A();}
  A* C;
};

int main()
{
 B<double> V;
}


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


How reproducible:
Always

Steps to Reproduce:
1.g++ testcode.cc
2.
3.
	

Actual Results:  j3.cc: In method `void B<T>::B () [with T = double]':
j3.cc:20:   instantiated from here
j3.cc:3: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


When 
~B(){ printf(" hi from ~B() \n"); C->A::~A();}
is replaced with
~B(){ printf(" hi from ~B() \n"); C->~A();}
code compiles are runs ok.

Additional info:

Comment 1 Alan Cox 2002-12-15 18:13:10 UTC
Confirmed still present in g++ 3.2


Comment 2 Richard Henderson 2004-10-02 00:50:49 UTC
Works as of 3.2.3-20.


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