[Issue 7862] New: Accepts-invalid template forward reference bug related to derivedMembers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 8 15:12:20 PDT 2012


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

           Summary: Accepts-invalid template forward reference bug related
                    to derivedMembers
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at klickverbot.at


--- Comment #0 from klickverbot <code at klickverbot.at> 2012-04-08 15:13:00 PDT ---
This code compiles using DMD e0cdcac, but failed as expected using DMD 2.058:
---
template B(T) {
  mixin(
    {
      foreach (name; __traits(derivedMembers, T)) {}
      return "struct B {}";
    }()
  );
}

struct A {
  pragma(msg, "A: ", __traits(compiles, B!(typeof(this))));
  B!(typeof(this)) c;
  static if (nonExistent!()) {}
}

auto d = A.init.c;
---

(output is »A: false«, but apparently the template can be instantiated
afterwards)

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