[Issue 10252] New: CTFE: Should generate error for shifts outside valid range

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 3 04:17:04 PDT 2013


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

           Summary: CTFE: Should generate error for shifts outside valid
                    range
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2013-06-03 04:17:02 PDT ---
Const-folding generates errors whenever a shift (>>, <<, or >>>) exceeds the
valid range. CTFE should too. For example, this code should fail to compile:
---
int foo()
{
     int shift = 60;
     int a = 5;
     return a << shift;
}
static assert(foo());

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