mirror of
https://github.com/zebrajr/ladybird.git
synced 2026-01-15 12:15:15 +00:00
AK: Ignore -Wfree-nonheap-object on RefCounted::unref
GCC 15 seems to raise a false positive here in some cases (cherry picked from commit 129c3ec0df061930e58f6d15d2ee4ad3e7599aad)
This commit is contained in:
committed by
Ali Mohammad Pur
parent
0f6f5cd353
commit
39a2a854be
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <AK/Assertions.h>
|
||||
#include <AK/Checked.h>
|
||||
#include <AK/Diagnostics.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/Platform.h>
|
||||
|
||||
@@ -62,7 +63,9 @@ public:
|
||||
if (new_ref_count == 0) {
|
||||
if constexpr (requires { that->will_be_destroyed(); })
|
||||
that->will_be_destroyed();
|
||||
delete static_cast<T const*>(this);
|
||||
// FIXME: GCC 15.1.0 seems to think this is reachable with non-heap objects
|
||||
// in some possibly Variant related cases.
|
||||
AK_IGNORE_DIAGNOSTIC("-Wfree-nonheap-object", delete static_cast<T const*>(this);)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user