https://bugs.kde.org/show_bug.cgi?id=511932

Paul Floyd <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REPORTED                    |RESOLVED
         Resolution|---                         |NOT A BUG
                 CC|                            |[email protected]

--- Comment #1 from Paul Floyd <[email protected]> ---
The first problem with this bug report is that you are using pejorative
language to describe the issue. Just stick to the facts.

The real problem is that your code is wrong.

You did not read this part of the cppreference description:

"If ptr is a pointer to a base class subobject of the object that was allocated
with new, the destructor of the base class must be virtual, otherwise the
behavior is undefined. "

Is your destructor virtual? No. So your code has UB and Valgrind is correctly
diagnosing a genuine error.

If I add a destuctor the B and rerun your code I get no errors.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to