mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +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:
parent
0f6f5cd353
commit
39a2a854be
Notes:
github-actions[bot]
2025-11-13 12:53:20 +00:00
Author: https://github.com/alimpfard
Commit: 39a2a854be
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6790
1 changed files with 4 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue