Skip to content
Commit 39005d30 authored by Eric Fiselier's avatar Eric Fiselier
Browse files

Fix PR27115 - enable_shared_from_this does not work as a virtual base class.

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

The problem was that the conversion from
'const enable_shared_from_this<T>*' to 'const T*' didn't work if
T inherited enable_shared_from_this as a virtual base class. The fix
is to take the original pointer passed to shared_ptr's constructor in the
__enable_weak_this method and perform an upcast to 'const T*' instead of
performing a downcast from the enable_shared_from_this base.

llvm-svn: 273835
parent 819f3b95
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment