Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 52881 - segmentation fault with nested class as parameter to constructor with default value
segmentation fault with nested class as parameter to constructor with default...
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-08-30 10:08 EDT by scott dallamura
Modified: 2007-04-18 12:36 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-12-15 12:42:40 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 scott dallamura 2001-08-30 10:08:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; COM+ 

Description of problem:
sorry the summary is so big ;)
when i try to use a nested class as an argument to a constructor for the 
enclosing class, g++ gives a segmentation fault.  if i move the nested 
class outside of the enclosing class, or if i don't use the " = 
ServiceInformation()", or even if i use " = ServiceInformation(0)" it 
works fine.

I guess it's not a huge problem, since it's really easy to work around, 
but i got really scared when gcc segfaulted.

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

How reproducible:

Steps to Reproduce:
1. make the following file "testes.h":
class testes {
	struct ServiceInformation {
		ServiceInformation(long lPID = 0)
			:PID(lPID) {};
		long PID;
	testes(const ServiceInformation &svcinf = ServiceInformation());

2. make this file testes.cpp:
#include "testes.h"

testes::testes(const ServiceInformation &svcinf) {

testes::~testes() {

3. compile the program:
g++ -c testes.cpp

Actual Results:  [sdallamura@vader testes]$ g++ testes.cpp
In file included from testes.cpp:1:
testes.h:9: Internal error: Segmentation fault.
Please submit a full bug report.

Expected Results:  it should have worked >:O

Additional info:

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