www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Internal error: e2ir.c 736 dmd0.147

reply BCS <BCS_member pathlink.com> writes:
DMD 0.147 w/ winXP

template foo(int i)
{
	const int bar = foo!(i).bar;
}

int main()
{
	return foo!(1).bar;
}
Feb 16 2006
parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

BCS schrieb am 2006-02-16:
 DMD 0.147 w/ winXP

 template foo(int i)
 {
 	const int bar = foo!(i).bar;
 }

 int main()
 {
 	return foo!(1).bar;
 }
Added to DStress as http://dstress.kuehne.cn/nocompile/t/template_29_A.d http://dstress.kuehne.cn/nocompile/t/template_29_B.d http://dstress.kuehne.cn/nocompile/t/template_29_C.d http://dstress.kuehne.cn/nocompile/t/template_29_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD9acd3w+/yD4P9tIRAhJ0AJ9zeaGW4+vYTpitwrLURlflebhoKACeIcME DA+DLkJys2Mc8kU1MRApens= =NriJ -----END PGP SIGNATURE-----
Feb 17 2006
parent reply BCS <BCS_member pathlink.com> writes:
Where can I find a listing of the markup syntax for the test cases.
I ask because case B and D should compile (or fail gracefully) and from what I 
can tell they are marked as "shouldn't compile".

Thomas Kuehne wrote:
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
 BCS schrieb am 2006-02-16:
 
DMD 0.147 w/ winXP

template foo(int i)
{
	const int bar = foo!(i).bar;
}

int main()
{
	return foo!(1).bar;
}
Added to DStress as http://dstress.kuehne.cn/nocompile/t/template_29_A.d http://dstress.kuehne.cn/nocompile/t/template_29_B.d http://dstress.kuehne.cn/nocompile/t/template_29_C.d http://dstress.kuehne.cn/nocompile/t/template_29_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD9acd3w+/yD4P9tIRAhJ0AJ9zeaGW4+vYTpitwrLURlflebhoKACeIcME DA+DLkJys2Mc8kU1MRApens= =NriJ -----END PGP SIGNATURE-----
Feb 17 2006
parent reply Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

BCS schrieb am 2006-02-17:
 Where can I find a listing of the markup syntax for the test cases.
The basic classification is done via directories: http://dstress.kuehne.cn/compile http://dstress.kuehne.cn/nocompile http://dstress.kuehne.cn/norun http://dstress.kuehne.cn/run http://dstress.kuehne.cn/undefined If you are interrested in the tags used: http://dstress.kuehne.cn/readme.html#testcase-settings and http://dstress.kuehne.cn/readme.html#sourcecode-metadata
 I ask because case B and D should compile (or fail gracefully) and from what I 
 can tell they are marked as "shouldn't compile".
 http://dstress.kuehne.cn/nocompile/t/template_29_B.d
 http://dstress.kuehne.cn/nocompile/t/template_29_D.d
For clarification I've replaced "uint" with "size_t". I'm not sure how they could succeed to compile without memory exhaustion and thus fail gracefully at compile time(hence: nocompile). Granted, an advanced compiler might be able to compile the given tests with 2 instead of size_t.max template instance - not sure how to fool that kind of compiler. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD9tlt3w+/yD4P9tIRAvqFAJ9yT2c2JKEF+3aK53yTrqTyMewHfACg0IIT VF67Ez+LrN38kgsYHYhEZoM= =2jYj -----END PGP SIGNATURE-----
Feb 18 2006
parent reply BCS <BCS_member pathlink.com> writes:
In article <e42jc3-6h7.ln1 birke.kuehne.cn>, Thomas Kuehne says...
 I ask because case B and D should compile (or fail gracefully) and from what I 
 can tell they are marked as "shouldn't compile".
 http://dstress.kuehne.cn/nocompile/t/template_29_B.d
 http://dstress.kuehne.cn/nocompile/t/template_29_D.d
For clarification I've replaced "uint" with "size_t". I'm not sure how they could succeed to compile without memory exhaustion and thus fail gracefully at compile time(hence: nocompile). Granted, an advanced compiler might be able to compile the given tests with 2 instead of size_t.max template instance - not sure how to fool that kind of compiler. Thomas
My point is that they are both (in theory) legal code and thus should nether crash DMD or generate a syntax error. In reality, nether can be expected to actually compile, but DMD should give some sort of rational error message like "Internal template recursion limit exceeded: Quitting".
Feb 19 2006
next sibling parent "Walter Bright" <newshound digitalmars.com> writes:
"BCS" <BCS_member pathlink.com> wrote in message 
news:dtb0fg$9pe$1 digitaldaemon.com...
 My point is that they are both (in theory) legal code and thus should 
 nether
 crash DMD or generate a syntax error. In reality, nether can be expected 
 to
 actually compile, but DMD should give some sort of rational error message 
 like
 "Internal template recursion limit exceeded: Quitting".
You're quite right.
Feb 20 2006
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

BCS schrieb am 2006-02-19:
 In article <e42jc3-6h7.ln1 birke.kuehne.cn>, Thomas Kuehne says...
 I ask because case B and D should compile (or fail gracefully) and from what I 
 can tell they are marked as "shouldn't compile".
 http://dstress.kuehne.cn/nocompile/t/template_29_B.d
 http://dstress.kuehne.cn/nocompile/t/template_29_D.d
For clarification I've replaced "uint" with "size_t". I'm not sure how they could succeed to compile without memory exhaustion and thus fail gracefully at compile time(hence: nocompile). Granted, an advanced compiler might be able to compile the given tests with 2 instead of size_t.max template instance - not sure how to fool that kind of compiler. Thomas
My point is that they are both (in theory) legal code and thus should nether crash DMD or generate a syntax error. In reality, nether can be expected to actually compile, but DMD should give some sort of rational error message like "Internal template recursion limit exceeded: Quitting".
The nocompile category of DStress includes several cases that are syntactically correct but lead to resource exhaustion. The compiler is expected to handle those cases gracefully. Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD/rii3w+/yD4P9tIRAsb5AJ9BDmgKvHIotjvn+reHygRYOid5SwCg0DB3 9YvuxC79IxG+hn3PgQI9tuA= =9tG0 -----END PGP SIGNATURE-----
Feb 23 2006