mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1743012 - Add missing constexpr
qualifiers in CheckedInt
, r=glandium
Differential Revision: https://phabricator.services.mozilla.com/D132173
This commit is contained in:
parent
ca6b1189ea
commit
b2dc7057a5
@ -349,7 +349,7 @@ struct IsMulValidImpl<T, false, false> {
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
inline bool IsMulValid(T aX, T aY) {
|
||||
constexpr bool IsMulValid(T aX, T aY) {
|
||||
#if MOZ_HAS_BUILTIN_OP_OVERFLOW
|
||||
T dummy;
|
||||
return !__builtin_mul_overflow(aX, aY, &dummy);
|
||||
@ -780,12 +780,12 @@ MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)
|
||||
#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS
|
||||
|
||||
template <typename T, typename U>
|
||||
inline bool operator==(const CheckedInt<T>& aLhs, U aRhs) {
|
||||
constexpr bool operator==(const CheckedInt<T>& aLhs, U aRhs) {
|
||||
return aLhs == castToCheckedInt<T>(aRhs);
|
||||
}
|
||||
|
||||
template <typename T, typename U>
|
||||
inline bool operator==(U aLhs, const CheckedInt<T>& aRhs) {
|
||||
constexpr bool operator==(U aLhs, const CheckedInt<T>& aRhs) {
|
||||
return castToCheckedInt<T>(aLhs) == aRhs;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user