[Issue 10547] New: DMD accepts function templates with no body.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 5 03:05:44 PDT 2013


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

           Summary: DMD accepts function templates with no body.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: brian-schott at cox.net


--- Comment #0 from brian-schott at cox.net 2013-07-05 03:05:42 PDT ---
DMD compiles the following code without complaining:

int templateFunction(A, B)(A a, B b);

>From the spec: "FunctionLiterals and function templates, since their function
bodies are always present, infer the pure, nothrow, and @safe attributes unless
specifically overridden."

Either the complier or the spec is wrong. The current iteration of my grammar
does not allow function bodies to be missing, since as far as I know, empty
function templates are useless aside from forcing DDoc generation.

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