Bug 1577 – static assert for testing char with char is not evaluatable

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-10-13T06:01:00Z
Last change time
2014-02-24T15:31:17Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
davidl

Comments

Comment #0 by davidl — 2007-10-13T06:01:17Z
char[] result=`1234123`; static assert(result[0]=='1'); testassert.d(2): static assert (cast(int)(result[0u]) == 49) is not evaluatable at compile time
Comment #1 by clugdbug — 2009-04-06T02:03:38Z
The behaviour is correct. 'result' is not a compile-time constant. In D1, the following code works: const char[] result=`1234123`; static assert(result[0]=='1');