AK: Allow AtomicRefCounted to destroy classes using virtual inheritance
This warning is suppressed in RefCounted.h as well.
This commit is contained in:
parent
0d29a3bb3b
commit
dd626013b9
1 changed files with 3 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
#include <AK/Assertions.h>
|
||||
#include <AK/Atomic.h>
|
||||
#include <AK/Checked.h>
|
||||
#include <AK/Diagnostics.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/Platform.h>
|
||||
|
||||
|
|
@ -73,7 +74,8 @@ public:
|
|||
if (new_ref_count == 0) {
|
||||
if constexpr (requires { that->will_be_destroyed(); })
|
||||
that->will_be_destroyed();
|
||||
delete that;
|
||||
// This GCC diagnostic gives a false positive on pointers to classes using virtual inheritance.
|
||||
AK_IGNORE_DIAGNOSTIC("-Wfree-nonheap-object", delete that;)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue