Bläddra i källkod

Kernel: Remove superfluous `alignas(T)` from `KResultOr<T>`

Since `m_storage` is already guaranteed to be correctly aligned for the
type, we can forgo specifying it for the entire class.

This fixes an error: previously, this would *force* the value type's
alignment on the entire class, which would try to make 1-byte aligned
ints with `KResultOr<bool>`. GCC somehow compiled this (probably just
ignored it), but this caused a build error with Clang.

Closes #8072
Daniel Bertalan 4 år sedan
förälder
incheckning
ffb118265b
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      Kernel/KResult.h

+ 1 - 1
Kernel/KResult.h

@@ -43,7 +43,7 @@ private:
 };
 
 template<typename T>
-class alignas(T) [[nodiscard]] KResultOr {
+class [[nodiscard]] KResultOr {
 public:
     KResultOr(KResult error)
         : m_error(error)