From 06c6c046f3f7f8972b2715a77bbf29fe7d14f9f3 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 20 May 2022 21:08:38 +0430 Subject: [PATCH] AK: Use static_cast to cast to base type This is an issue on systems that don't have the empty base class optimisation (such as windows), and we normally don't need to care - however static_cast is technically the right thing to use, so let's use that instead. Co-Authored-By: Daniel Bertalan --- AK/Variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/Variant.h b/AK/Variant.h index c0919ab01ed..30856ca9a93 100644 --- a/AK/Variant.h +++ b/AK/Variant.h @@ -148,7 +148,7 @@ private: { // Warning: Internal type shenanigans - VariantsConstrutors <- Base // Not the other way around, so be _really_ careful not to cause issues. - return *reinterpret_cast(this); + return *static_cast(this); } };