forked from OSchip/llvm-project
[flang] Prep for review
Original-commit: flang-compiler/f18@a9439ee83c Reviewed-on: https://github.com/flang-compiler/f18/pull/209
This commit is contained in:
parent
fa671ab542
commit
884d9057d0
|
@ -432,10 +432,9 @@ public:
|
||||||
|
|
||||||
EVALUATE_UNION_CLASS_BOILERPLATE(Expr)
|
EVALUATE_UNION_CLASS_BOILERPLATE(Expr)
|
||||||
explicit Expr(const Scalar<Result> &x) : u{Constant<Result>{x}} {}
|
explicit Expr(const Scalar<Result> &x) : u{Constant<Result>{x}} {}
|
||||||
template<typename INT> explicit Expr(std::enable_if_t<std::is_integral_v<INT>, INT> n) : u(Constant<Result>{
|
template<typename INT>
|
||||||
n}
|
explicit Expr(std::enable_if_t<std::is_integral_v<INT>, INT> n)
|
||||||
} {
|
: u{Constant<Result>{n}} {}
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using Conversions = std::variant<Convert<Result, TypeCategory::Integer>,
|
using Conversions = std::variant<Convert<Result, TypeCategory::Integer>,
|
||||||
|
@ -448,7 +447,7 @@ using Others =
|
||||||
|
|
||||||
public:
|
public:
|
||||||
common::CombineVariants<Operations, Conversions, Others> u;
|
common::CombineVariants<Operations, Conversions, Others> u;
|
||||||
}; // namespace Fortran::evaluate
|
};
|
||||||
|
|
||||||
template<int KIND>
|
template<int KIND>
|
||||||
class Expr<Type<TypeCategory::Real, KIND>>
|
class Expr<Type<TypeCategory::Real, KIND>>
|
||||||
|
|
|
@ -120,8 +120,8 @@ public:
|
||||||
|
|
||||||
// C++'s integral types can all be converted to Integer
|
// C++'s integral types can all be converted to Integer
|
||||||
// with silent truncation.
|
// with silent truncation.
|
||||||
template<typename INT>
|
template<typename INT> constexpr Integer(INT n) {
|
||||||
constexpr Integer(std::enable_if<std::is_integral_v<INT>, INT> n) {
|
static_assert(std::is_integral_v<INT>);
|
||||||
constexpr int nBits = CHAR_BIT * sizeof n;
|
constexpr int nBits = CHAR_BIT * sizeof n;
|
||||||
if constexpr (nBits < partBits) {
|
if constexpr (nBits < partBits) {
|
||||||
if constexpr (std::is_unsigned_v<INT>) {
|
if constexpr (std::is_unsigned_v<INT>) {
|
||||||
|
|
Loading…
Reference in New Issue