Thread overview | |||||
---|---|---|---|---|---|
|
September 16, 2006 [Issue 353] New: null passed as a char[] template argument, concatenated with a string literal, is a non-constant expression | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=353 Summary: null passed as a char[] template argument, concatenated with a string literal, is a non-constant expression Product: D Version: 0.166 Platform: PC OS/Version: Windows Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: smjg@iname.com ---------- template Qwert(char[] yuiop) { const char[] Qwert = yuiop ~ "asdfg"; } void main() { char[] hjkl = Qwert!(null); } ---------- D:\My Documents\Programming\D\Tests\bugs\string_template7.d(2): non-constant expression null ~ "asdfg" ---------- No such error occurs if null is replaced by a string literal, or if line 2 is changed to const char[] Qwert = yuiop; If, starting with the original code, hjkl is declared at module level, the error is doubled: ---------- template Qwert(char[] yuiop) { const char[] Qwert = yuiop ~ "asdfg"; } char[] hjkl = Qwert!(null); ---------- D:\My Documents\Programming\D\Tests\bugs\string_template7a.d(5): non-constant expression null ~ "asdfg" D:\My Documents\Programming\D\Tests\bugs\string_template7a.d(2): non-constant expression null ~ "asdfg" ---------- If hjkl is declared as const and at module level, then the error is tripled (at lines 5, 2 and 2). -- |
November 25, 2006 [Issue 353] null passed as a char[] template argument, concatenated with a string literal, is a non-constant expression | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/issues/show_bug.cgi?id=353 bugzilla@digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #2 from bugzilla@digitalmars.com 2006-11-25 03:49 ------- Fixed DMD 0.175 -- |
Copyright © 1999-2021 by the D Language Foundation