diff --git a/AK/Checked.h b/AK/Checked.h index eaeb1bc3f2..8d5321d5b6 100644 --- a/AK/Checked.h +++ b/AK/Checked.h @@ -104,7 +104,7 @@ struct TypeBoundsChecker { }; template -constexpr bool is_within_range(Source value) +[[nodiscard]] constexpr bool is_within_range(Source value) { return TypeBoundsChecker::is_within_range(value); } @@ -149,7 +149,7 @@ public: return *this; } - constexpr bool has_overflow() const + [[nodiscard]] constexpr bool has_overflow() const { return m_overflow; } @@ -265,7 +265,7 @@ public: } template - static constexpr bool addition_would_overflow(U u, V v) + [[nodiscard]] static constexpr bool addition_would_overflow(U u, V v) { #ifdef __clang__ Checked checked; @@ -278,7 +278,7 @@ public: } template - static constexpr bool multiplication_would_overflow(U u, V v) + [[nodiscard]] static constexpr bool multiplication_would_overflow(U u, V v) { #ifdef __clang__ Checked checked; @@ -291,7 +291,7 @@ public: } template - static constexpr bool multiplication_would_overflow(U u, V v, X x) + [[nodiscard]] static constexpr bool multiplication_would_overflow(U u, V v, X x) { Checked checked; checked = u;