[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
Thu Feb 2 01:12:10 PST 2012


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



--- Comment #4 from Don <clugdbug at yahoo.com.au> 2012-02-02 01:12:07 PST ---
(In reply to comment #3)
> Looking at that git commit, if I add back in the following code that was
> elided:
> 
> 3450a3451,3459
> >
> > #if 1
> > if (op==TOKconstruct && this->e1->op==TOKvar && this->e2->op != TOKthis
> >         && this->e2->op != TOKcomma
> >         && ((VarExp*)this->e1)->var->storage_class & STCref)
> >         wantRef = true;
> > #endif
> >
> >
> 
> then it works.
> 
> Note that when -inline is used, the only function that gets inlined is the
> constructor call.
> 
> Note the comment for the elision, saying it is to fix something with foreach,
> yet foreach is not in this example, I think the problem is in CTFE.

That code was introduced as a hack to get ref foreach to work in CTFE, but it
isn't correct (the != TOKthis and != TOKcomma is a hack). Later, after fixing
some other bugs, ref foreach works without it.

I have made a proper fix, which I will post tonight.

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