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

           Summary: struct passed to template: cannot access frame pointer
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: beatgam...@gmail.com


--- Comment #0 from Jameson <beatgam...@gmail.com> 2012-10-21 11:13:20 PDT ---
import std.traits;

    auto fun(T)(out T ret) {
    }

    version(none) {
        auto fun(T)(T ret) {
        }
    }

    void main() {
        struct A {
            auto f() {
            }
        }

        A a;
        fun!A(a);
    }

With the latest dmd (from HEAD), I get the following compile errors:

    test.d(3): Error: cannot access frame pointer of test.main.A
    test.d(18): Error: template instance test.fun!(A) error instantiating

This only happens when the struct has a function and it's passed as an out
parameter. This worked fine on DMD 2.060, but breaks with the HEAD on master.

Any following will cause this to compile:

* remove f()
* make A static
* change out in fun to anything else (ref, in, ...)

This may be related to http://d.puremagic.com/issues/show_bug.cgi?id=8850

Tests run on Linux x64, dmd compiled with 'gmake -f posix.mak MODEL=64;'

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

Reply via email to