diff options
author | Daniel Bertalan <dani@danielbertalan.dev> | 2021-06-24 10:43:59 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-24 17:35:49 +0430 |
commit | ffb118265b3f3481b4edc197b51e84c0c10531c1 (patch) | |
tree | 007f964fe06b34abc5f155d9641fff29806415ac /Kernel | |
parent | 2d2747cb15a369e2c80c4039e56cd21b6fae510c (diff) | |
download | serenity-ffb118265b3f3481b4edc197b51e84c0c10531c1.zip |
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
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/KResult.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/KResult.h b/Kernel/KResult.h index 05cc34b61b..793d65438e 100644 --- a/Kernel/KResult.h +++ b/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) |