https://issues.dlang.org/show_bug.cgi?id=16652

--- Comment #3 from Walter Bright <bugzi...@digitalmars.com> ---
(In reply to Walter Bright from comment #2)
> It's the inlining of bar() that elicits the bug.

Looking at the AST for main() without inlining:

  _D4test3barFPhZv call  (dctor  info  ((__slVecto3 = 0) , (Vector.ctor call 
(1  param  &__slVecto3))));
  ddtor (Vector.dtor call  &__slVecto);
  0L ;

and it looks correct. With inlining:


  v = (dctor info ((__slVecto3 =  0) , (Vector.ctor call  (1  param 
&__slVecto3))));
  ddtor (Vector.dtor call  &__slVecto3);
  (*v == 1) || (_d_assertp call  (19L  param  #__a6_746573742e64));
  0L ;

and the destructor call is clearly too soon.

--

Reply via email to