1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

AK: Allow NonnullRefPtr::ptr() when in "unknown" typestate.

Clang loses the typestate when passing NonnullRefPtr's via lambda captures.
This is unfortunate, but not much we can do about it. Allowing ptr() makes
it possible to use captured NonnullRefPtrs as you'd expect.
This commit is contained in:
Andreas Kling 2019-07-25 11:51:24 +02:00
parent f46a1377ac
commit afc638c3ab
2 changed files with 7 additions and 3 deletions

View file

@ -148,13 +148,13 @@ public:
return *leakedPtr;
}
CALLABLE_WHEN(unconsumed)
CALLABLE_WHEN("unconsumed","unknown")
T* ptr()
{
ASSERT(m_ptr);
return m_ptr;
}
CALLABLE_WHEN(unconsumed)
CALLABLE_WHEN("unconsumed","unknown")
const T* ptr() const
{
ASSERT(m_ptr);