🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1894

BUG(s) in G++ 1.34.1 and 1.35.0 (pre-release)

#1894
From: Ron Guilmette
Date: Fri, 21 Apr 1989 19:28
52 lines
1314 bytes
The following source file causes G++ 1.34.1 (Sun3) and G++ 1.35.0 (Sun3,
pre-release from yahi April 20th) to abort.

----------------------------------------------------------------------- 
// Check that default arguments may be non constant expressions

// #include "Testinc.h"

int global_variable;
const int global_const = 99;

int func1 (int i);
int func2 (int j);

int function (int k = func2 (func1 (global_variable + global_const)));

class base {
	int field;
public:
	int function (int k = func2 (func1 (global_variable + global_const)));
};

int test ()
{
	base b;

	global_variable = 99;
	function ();
	b.function ();
	return 0;
}

int function (int k = func2 (func1 (global_variable + global_const)))
{
	return 0;
}

int base::function (int k = func2 (func1 (global_variable + global_const)))
{
	return 0;
}

int func1 (int i)
{
	return 1+i;
}

int func2 (int j)
{
	return 2+j;
}
Technical Details
Message-ID: <8904211928.AA13546@riunite.aca.mcc.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg
From: rfg@MCC.COM (Ron Guilmette)
Newsgroups: gnu.g++.bug
Subject: BUG(s) in G++ 1.34.1 and 1.35.0 (pre-release)
Message-ID: <8904211928.AA13546@riunite.aca.mcc.com>
Date: 21 Apr 89 19:28:50 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 52