[Issue 8857] [CTFE] does not evaluate to a boolean, only with -inline

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 6 11:46:55 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8857


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[CTFE] Referring to a wrong |[CTFE] does not evaluate to
                   |member of a sruct in CTFE   |a boolean, only with
                   |with -inline                |-inline


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2012-11-06 11:46:53 PST ---
Original title:
[CTFE] Referring to a wrong member of a struct in CTFE with -inline

Actually it isn't using a wrong struct member. What happens is that the inliner
changes
if(r.match){ // line 5
        auto next = r.next;
}

into:
  r.match && (string next = r.next);

The CTFE engine cannot currently cope with this expression, and gives an error.
It's the wrong line number, though this hardly matters since it's really an
internal compiler error.

It's quite an obscure bug, in that it is only triggered with -inline (the code
after inlining is not valid D code) + a true condition + an assignment where
the value is null.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list