mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1247338 - really make Atomic's constructor constexpr; r=Waldo
Atomic's constructor is marked as constexpr, but it calls a non-constexpr function, ToStorageTypeArgument::convert. For compilers which require constexpr-ness on constructors to inline away the actual constructor call, the call to ToStorageTypeArgument::convert completely disables the constexpr-ness of the constructor. Let's fix this by marking all relevant instances of ToStorageTypeArgument::convert as MOZ_CONSTEXPR, thus satisfying the compiler once again.
This commit is contained in:
parent
2fe8022dbb
commit
57c59afe5a
@ -323,7 +323,7 @@ struct AtomicIntrinsics<T*, Order>
|
||||
template<typename T>
|
||||
struct ToStorageTypeArgument
|
||||
{
|
||||
static T convert (T aT) { return aT; }
|
||||
static MOZ_CONSTEXPR T convert (T aT) { return aT; }
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
@ -514,13 +514,13 @@ struct ToStorageTypeArgument
|
||||
{
|
||||
typedef typename AtomicStorageType<T>::Type ResultType;
|
||||
|
||||
static ResultType convert (T aT) { return ResultType(aT); }
|
||||
static MOZ_CONSTEXPR ResultType convert (T aT) { return ResultType(aT); }
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct ToStorageTypeArgument<T, false>
|
||||
{
|
||||
static T convert (T aT) { return aT; }
|
||||
static MOZ_CONSTEXPR T convert (T aT) { return aT; }
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
Loading…
Reference in New Issue
Block a user