[Issue 7419] [2.058/CTFE] Constructor of struct is overwritten inside a unittest with -inline

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 1 13:29:04 PST 2012


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug at yahoo.com.au
         AssignedTo|nobody at puremagic.com        |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2012-02-01 13:29:03 PST ---
It doesn't need unittest. The -inline seems to be necessary, I presume it's
creating a ref variable.

struct X7419 {
    double x;
    this(double x) {
        this.x = x;
    }
}

void bug7419() {
    enum x = {
        auto p = X7419(3);
        return p.x;
    }();
    static assert(x == 3);
}

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