https://bugs.llvm.org/show_bug.cgi?id=35517

Konstantin Morshnev <m...@design.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #3 from Konstantin Morshnev <m...@design.ru> ---
> has a good description of deleting destructors.

The description is clear and we know it. But it is about dynamic objects
(MyStruct *ss=new MyStruct), and we have a stack object (MyStruct ss).

And if you'll and some printfs (like https://godbolt.org/g/fW4QZk) you'll see,
that delete is not called. It looks like there are two destructor versions are
generated - one with delete call and one without. But if the one with delete is
not referenced, why it is not optimized out?

> FWIW, your testcase only compiles in GCC 6.1 because they changed their 
> default standard mode to C++14

Thx for this note.

P.S. As a workaround we are temporary disabling virtual destructors to check
that build-in delete is not used in our code, but it's not very convenient.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to