Bug 641 – Complex string operations in template argument ICEs dmd

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2006-12-03T11:24:00Z
Last change time
2014-02-15T13:22:25Z
Assigned to
bugzilla
Creator
kinaba

Comments

Comment #0 by kinaba — 2006-12-03T11:24:35Z
// credit goes to http://pc8.2ch.net/test/read.cgi/tech/1158013550/960 template g(char[] s){} void main(){ g!(([""]~[])[0]); } ---------------- Assertion failure: 'e1->type' on line 5933 in file 'expression.c' abnormal program termination
Comment #1 by thomas-dloop — 2006-12-10T11:06:23Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-12-03: > http://d.puremagic.com/issues/show_bug.cgi?id=641 > // credit goes to http://pc8.2ch.net/test/read.cgi/tech/1158013550/960 > template g(char[] s){} > void main(){ g!(([""]~[])[0]); } > ---------------- > Assertion failure: 'e1->type' on line 5933 in file 'expression.c' > > abnormal program termination Added to DStress as http://dstress.kuehne.cn/nocompile/b/bug_expression_5981_A.d http://dstress.kuehne.cn/nocompile/b/bug_expression_5981_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFfD1+LK5blCcjpWoRAvoVAJ9lvcJImrCFHIt6r+7ZHTxW/L3EmQCgn+vB qhCxP3anL46QmSwS5rxtKfg= =tHHZ -----END PGP SIGNATURE-----
Comment #2 by thomas-dloop — 2007-04-27T12:38:10Z
DMD-1.013 doesn't segfault but produces a funny error message: 14 template g(char[] s){ 15 } 16 17 void foo(){ 18 g!(([""]~[])[0]); 19 } nocompile/b/bug_expression_5981_A.d(18): Error: import has no effect in expression (g!(""))
Comment #3 by bugzilla — 2007-07-01T13:27:17Z
Fixed DMD 1.018 and DMD 2.002