bug : consecutive function calls and -inline

noob-is-noob noob at gmail.com
Sat May 24 07:56:01 PDT 2008


Frits van Bommel wrote:
> noob-is-noob wrote:
>> <snip>
> 
> This definitely looks like a bug to me. However, the second behavior 
> (w/o -inline) is the correct one. opCall returns a *copy* of the struct 
> it's called on, so only the initial call in each sequence should modify 
> the original. The other two should modify copies. That means only "AAA" 
> and "<-result" should be in t.arr at the end of main().
> Since GDC gets this right, it's probably a bug in the DMD inliner.
> 
> I've entered this into bugzilla: 
> <http://d.puremagic.com/issues/show_bug.cgi?id=2127>

Thank you. I take janderson's advice, change to use class,
and avoid return struct *this.


More information about the Digitalmars-d-learn mailing list