www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - -inline with 'with'

reply Victor Nakoryakov <nail-mail mail.ru> writes:
Hi all.

 module core;
 
 struct Struct
 {
 	static Struct foo()
 	{
 		Struct s;		
 		with (s) {} // bug
 		return s;
 	}
 
 	static Struct bar()
 	{
 		return Struct.foo() * Struct.foo();
 	}
 	
 	Struct opMul(Struct s)
 	{
 		return s;
 	}
 }
 
 int main(char[][] args)
 {
 	return 0;	
 }

D:\proj\dtest>dmd -O -release -inline core.d core.d(15): foo() is not an lvalue Snipet has no error if there is no -inline flag or if I'll comment line marked as bug. -- Victor (aka nail) Nakoryakov nail-mail<at>mail<dot>ru Krasnoznamensk, Moscow, Russia
Jun 23 2005
parent Thomas Kuehne <thomas-dloop kuehne.this-is-spam.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Victor Nakoryakov schrieb am Thu, 23 Jun 2005 14:33:39 +0400:
 Hi all.

 module core;
 
 struct Struct
 {
 	static Struct foo()
 	{
 		Struct s;		
 		with (s) {} // bug
 		return s;
 	}
 
 	static Struct bar()
 	{
 		return Struct.foo() * Struct.foo();
 	}
 	
 	Struct opMul(Struct s)
 	{
 		return s;
 	}
 }
 
 int main(char[][] args)
 {
 	return 0;	
 }

D:\proj\dtest>dmd -O -release -inline core.d core.d(15): foo() is not an lvalue Snipet has no error if there is no -inline flag or if I'll comment line marked as bug.

Added to DStress as http://dstress.kuehne.cn/run/i/inline_11_A.d http://dstress.kuehne.cn/run/i/inline_11_B.d http://dstress.kuehne.cn/run/i/inline_11_C.d http://dstress.kuehne.cn/run/i/inline_11_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCu76C3w+/yD4P9tIRAognAJsE4g2UYfUt8nV0szsSGxJYLPVNnwCdEl2o mKTIEwq8sbLnYQSwuNBjOfQ= =pNu2 -----END PGP SIGNATURE-----
Jun 24 2005