Browse Source

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 <dani@danielbertalan.dev>
Ali Mohammad Pur 3 years ago
parent
commit
06c6c046f3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      AK/Variant.h

+ 1 - 1
AK/Variant.h

@@ -148,7 +148,7 @@ private:
     {
         // Warning: Internal type shenanigans - VariantsConstrutors<T, Base> <- Base
         //          Not the other way around, so be _really_ careful not to cause issues.
-        return *reinterpret_cast<Base*>(this);
+        return *static_cast<Base*>(this);
     }
 };