-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
weak_ptr
conversions can sometimes avoid locking
#2282
weak_ptr
conversions can sometimes avoid locking
#2282
Conversation
Resolves microsoft#258 Test happen to recreate the issue for me on attempt #0 if unconditionally avoid locking
rather than C-style casts because we don't need to punch through accessibility
weak_ptr
conversions can sometimes avoid locking
IIUC this does not optimize for the |
Good point, but I preferred to update the existing check to cover Derived -> const Base as well |
tests/std/tests/Dev10_851347_weak_ptr_virtual_inheritance/test.cpp
Outdated
Show resolved
Hide resolved
@cpplearner I think that @AlexGuteniev's code does handle Suppose that we're constructing a template <class _Ty2>
static constexpr bool _Is_virtual_base_cast<_Ty2, decltype(static_cast<const _Ty2*>(_STD declval<_Ty*>()))> = false; This starts with At a high level, the technique is saying that when implicitly converting from source-to-dest (whether adding constness or converting derived-to-base), a (Aside: I noticed that this doesn't consider |
For the record, @cpplearner comment was useful, as I added |
Thanks for finding the EDG bug! I reported it as DevCom-1564433 and pushed a perma-workaround after discovering that changing |
As we don't need to skip EDG here
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
@AlexGuteniev @CaseyCarter I've pushed changes to fix test failures for |
Having recently begun my fourth trip through the Wheel of Time, I'm deeply offended that you would liken |
Thanks for implementing this long-dreamed-of optimization! 🐈 💤 😻 |
Resolves #258
Test happen to recreate the issue for me on attempt #0
if unconditionally avoid locking