Summary: DMD accepts illegal template metaprogram
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-09-08 15:01:25 PDT ---
DMD 2.060:
template BrokenY(alias F){
    template BrokenY(A...){
        template Z(alias X){
            alias F!(X,A) Z;
        alias Z!Z BrokenY;
template AlmostFact(alias BrokenFact, int n){
    static if(n) enum AlmostFact = n*BrokenFact!(n-1);
    else enum AlmostFact=1;
alias BrokenY!AlmostFact BrokenFact;
pragma(msg, BrokenFact!3); // "36"

DMD accepts this code, but it is invalid. It seems to be some kind of lookup
problem. Consistently renaming one of the two BrokenFact aliases makes the
problem disappear.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to