[Issue 6538] New: Invalid template constraints crash compiler

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 20 06:57:01 PDT 2011


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

           Summary: Invalid template constraints crash compiler
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2011-08-20 06:57:00 PDT ---
The following code crashes the compiler on Windows:

template allSatisfy(alias F, T...)
{
    enum bool allSatisfy = true;
}

template isIntegral(T)
{
    enum bool isIntegral = true;
}

// This is invalid because allSatisfy is passed sizes, not I.
void foo(I...)(I sizes)
if(allSatisfy!(isIntegral, sizes)) {}

void main() {
    auto arr = foo(42, 86);
}

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