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:
parent
f46a1377ac
commit
afc638c3ab
2 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue