fixed contexpr modifier build, updated tests

This commit is contained in:
myrrc 2020-11-02 14:47:59 +03:00
parent 19fcea88f2
commit 5c77ae914f
4 changed files with 614 additions and 622 deletions

View File

@ -14,7 +14,7 @@ namespace ErrorCodes
namespace
{
constexpr bool allowType(const DataTypePtr& type) noexcept
bool allowType(const DataTypePtr& type) noexcept
{
const WhichDataType t(type);
return t.isInt() || t.isUInt() || t.isFloat() || t.isDecimal();

View File

@ -17,16 +17,8 @@ struct RationalFraction
Float64 numerator{0};
Denominator denominator{0};
Float64 NO_SANITIZE_UNDEFINED result() const
{
if constexpr (std::numeric_limits<Float64>::is_iec559)
return static_cast<Float64>(numerator) / denominator; /// allow division by zero
if (denominator == static_cast<Denominator>(0))
return static_cast<Float64>(0);
return static_cast<Float64>(numerator / denominator);
}
/// Allow division by zero as sometimes we need to return NaN.
Float64 NO_SANITIZE_UNDEFINED result() const { return numerator / denominator; }
};
/**

View File

@ -15,7 +15,7 @@ namespace ErrorCodes
namespace
{
constexpr bool allowTypes(const DataTypePtr& left, const DataTypePtr& right) noexcept
bool allowTypes(const DataTypePtr& left, const DataTypePtr& right) noexcept
{
const WhichDataType l_dt(left), r_dt(right);