[Bug libstdc++/58839] Regression: dereferencing void* in shared_ptr(unique_ptr&& u) constructor

mrlika at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 24 08:42:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58839

--- Comment #2 from Andriy Lysnevych <mrlika at gmail dot com> ---
Hi Paolo,

You are right. It is not yours commit but next one.

__r.get() returns T* and construction *__r.get() works for any type except the
case when T=void. It causes dereferencing of void pointer that is prohibited by
standard.
When code creates unique_ptr<void> a resource hidden behind void pointer (most
likely with custom deleter functionality) and then tries to pass it to
shared_ptr<void>(unique_ptr<void>&&) constructor we get this void dereferencing
error.

Regards



More information about the Gcc-bugs mailing list