Thread overview
[Issue 7862] New: Accepts-invalid template forward reference bug related to derivedMembers
Apr 08, 2012
klickverbot
Apr 09, 2012
Walter Bright
April 08, 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@puremagic.com
        ReportedBy: code@klickverbot.at


--- Comment #0 from klickverbot <code@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: -------
April 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7862



--- Comment #1 from github-bugzilla@puremagic.com 2012-04-08 17:35:38 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d16cfe5047dc1a1768dbf216414d55b920341112
fix Issue 7862 - Accepts-invalid template forward reference bug related to
derivedMembers

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 09, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7862


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------