Thread overview
[Issue 992] New: CTFE Failure with static if
Feb 21, 2007
d-bugmail
Feb 23, 2007
d-bugmail
Feb 23, 2007
d-bugmail
Feb 26, 2007
d-bugmail
Mar 09, 2007
d-bugmail
Mar 11, 2007
d-bugmail
February 21, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=992

           Summary: CTFE Failure with static if
           Product: D
           Version: 1.006
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: webmaster@villagersonline.com


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


-- 

February 23, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=992


webmaster@villagersonline.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from webmaster@villagersonline.com  2007-02-22 22:40 -------
Looks like this was fixed in 1.007.


-- 

February 23, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=992


webmaster@villagersonline.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Comment #2 from webmaster@villagersonline.com  2007-02-23 10:54 -------
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.


-- 

February 26, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=992





------- Comment #3 from thomas-dloop@kuehne.cn  2007-02-26 05:37 -------
Added to DStress as http://dstress.kuehne.cn/compile/a/assert_20_A.d http://dstress.kuehne.cn/compile/a/assert_20_B.d http://dstress.kuehen.cn/run/s/static_if_08_A.d http://dstress.kuehen.cn/run/s/static_if_08_B.d


-- 

March 09, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=992





------- Comment #4 from bugzilla@digitalmars.com  2007-03-09 01:55 -------
Please create new bug reports rather than reopen closed one for new situations.


-- 

March 11, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=992


webmaster@villagersonline.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Comment #5 from webmaster@villagersonline.com  2007-03-11 15:44 -------
Fixed in 1.009.


--