🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

(none)

#1303
From: Werner Benger
Date: Fri, 18 Dec 1992 17:16
62 lines
1443 bytes
 There is a new error in the GNU C++ 2.3.2 Compiler, which had not
been in version 2.2.2 .  When compiling the following program, the
Compiler complains "bad argument 0 for function B::B".

/*************************  ERROR 1 *****************************************/
#include <stdio.h>

struct	A
{	int sum;

	A(int i,int j,int k)
	{
		sum=i+j+k;
	}
};

struct	B
{	int Sum;

	B(const A&a,const A&b)
	{
		Sum = a.sum + b.sum;
	}
};

B testB(A(1,2,3),A(4,5,6));

main()
{
	printf("21==? %u\n",testB.Sum);
	return 0;
}

/************************************************************************/
There is also an old error, which had already occured in version 2.2.2 .

/**************************** ERROR 2 ***********************************/
struct X
{
 	struct Y
 	{
 		Y()	{}		
 	};
 	
 	X::Y operator()(int x,int y);
 	{
 	X::Y Z; 
 		return Z; 
 	}
};
 
main()
{
X	a;
X::Y	b=a(0,0);
 
}

/***************************************************************************/
 
	Best greetings from  werner@ast1.uibk.ac.at 
 
Technical Details
Message-ID: <9212181516.AA08178@mwa.uibk.ac.at>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mwa.uibk.ac.at!c70623

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!mwa.uibk.ac.at!c70623
From: c70623@mwa.uibk.ac.at (Werner Benger)
Subject: (none)
Message-ID: <9212181516.AA08178@mwa.uibk.ac.at>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Fri, 18 Dec 1992 17:16:56 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 66