Bug 992 – CTFE Failure with static if

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-02-21T17:38:00Z
Last change time
2014-02-16T15:26:21Z
Assigned to
bugzilla
Creator
webmaster

Comments

Comment #0 by webmaster — 2007-02-21T17:38:34Z
The following code fails with dmd.1.006: bool isWhitespace(char c) { return true; } static if(isWhitespace('c')) int x; with the messages foo.d(4): Error: expression (isWhitespace)('c') is not constant or does not evaluate to a bool
Comment #1 by webmaster — 2007-02-22T22:40:13Z
Looks like this was fixed in 1.007.
Comment #2 by webmaster — 2007-02-23T10:54:28Z
Looks like static assert() now has this problem in dmd.1.007. That is, change static if() in the example code to static assert() and we get the same problem.
Comment #3 by thomas-dloop — 2007-02-26T05:37:25Z
Comment #4 by bugzilla — 2007-03-09T01:55:55Z
Please create new bug reports rather than reopen closed one for new situations.
Comment #5 by webmaster — 2007-03-11T15:44:29Z
Fixed in 1.009.