Summary: branches that are known as not taken at compile time
                    should not be checked
           Product: D
           Version: D1
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Fawzi Mohamed <> 2010-06-18 02:46:43 PDT ---
I see the following code as valid, and thus the present bug as "rejects-valid"

module bug;
extern(C) int printf(char*,...);

void f(S...)(S args){
    if (args[0].length>1 && args[0][1]>='0' && args[0][1]<='9'){

void main(){

while the check in the if is correctly ignored (as it is unreachable because
the length of args[0] is 1) the body of the if still checks args[0][1] and
finds that it is out of bounds and rejects it.

bug.d(6): Error: array index 1 is out of bounds _param_0[0 .. 1]

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to