[Issue 7604] statically disallow shift amounts provably outside the valid range

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 18 21:23:17 PDT 2012


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


Ryuichi OHORI <r.97all at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.97all at gmail.com


--- Comment #1 from Ryuichi OHORI <r.97all at gmail.com> 2012-09-18 21:24:17 PDT ---
In my opinion, if compiler rejects
 int << 32, ulong >> 64, ...,
this also should be a runtime error:

// http://dpaste.dzfl.pl/689920e3
void main()
{
    ulong x = ulong.max;
    foreach (i; 0..64)
    {
        (x >> (64 - i)).writeln();
    }
}

-- 
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