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


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #2 from Don <clugd...@yahoo.com.au> 2011-07-20 16:23:32 PDT ---
(In reply to comment #0)
> Test case:
> 
> ------------------------
> static assert(!{
>     auto p = null;
>     return p !is null;
> }());
> ------------------------
> x.d(1): Error: static assert  (!true) is false
> ------------------------
> 
> The problem is the strange statement 'cmp ^= -1' in
> https://github.com/D-Programming-Language/dmd/blob/master/src/interpret.c#L2338.
> When two pointers are both null, 'cmp' will be 1, and 'cmp ^ -1' is -2 which 
> is
> also true.

IIRC that was copied from Equals() in constfold.c. The bug probably exists
there as well.

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

Reply via email to