[Issue 6661] New: Templates instantiated only through is(typeof()) shouldn't cause errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 13 02:44:58 PDT 2011


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

           Summary: Templates instantiated only through is(typeof())
                    shouldn't cause errors
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            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> 2011-09-13 02:44:40 PDT ---
The template blaz!int cannot be instantiated without errors, because it
contains an assignment of a string literal to int. But, since it is not
actually instantiated, it shouldn't cause a compile error.

template blaz(Q)
{
    int qutz(Q y)
    {
        Q q = "abc";
        return 67;
    }
    static assert(qutz(13).sizeof!=299);
    const Q blaz = 6;
}

static assert(is(typeof(blaz!(int).blaz)));

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