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,23 +432,22 @@ public:
|
|||
|
||||
EVALUATE_UNION_CLASS_BOILERPLATE(Expr)
|
||||
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>{
|
||||
n}
|
||||
} {
|
||||
}
|
||||
template<typename INT>
|
||||
explicit Expr(std::enable_if_t<std::is_integral_v<INT>, INT> n)
|
||||
: u{Constant<Result>{n}} {}
|
||||
|
||||
private:
|
||||
using Conversions = std::variant<Convert<Result, TypeCategory::Integer>,
|
||||
Convert<Result, TypeCategory::Real>>;
|
||||
using Operations = std::variant<Parentheses<Result>, Negate<Result>,
|
||||
Add<Result>, Subtract<Result>, Multiply<Result>, Divide<Result>,
|
||||
Power<Result>, Extremum<Result>>;
|
||||
using Others =
|
||||
std::variant<Constant<Result>, Designator<Result>, FunctionRef<Result>>;
|
||||
using Conversions = std::variant<Convert<Result, TypeCategory::Integer>,
|
||||
Convert<Result, TypeCategory::Real>>;
|
||||
using Operations = std::variant<Parentheses<Result>, Negate<Result>,
|
||||
Add<Result>, Subtract<Result>, Multiply<Result>, Divide<Result>,
|
||||
Power<Result>, Extremum<Result>>;
|
||||
using Others =
|
||||
std::variant<Constant<Result>, Designator<Result>, FunctionRef<Result>>;
|
||||
|
||||
public:
|
||||
common::CombineVariants<Operations, Conversions, Others> u;
|
||||
}; // namespace Fortran::evaluate
|
||||
common::CombineVariants<Operations, Conversions, Others> u;
|
||||
};
|
||||
|
||||
template<int KIND>
|
||||
class Expr<Type<TypeCategory::Real, KIND>>
|
||||
|
|
|
@ -120,8 +120,8 @@ public:
|
|||
|
||||
// C++'s integral types can all be converted to Integer
|
||||
// with silent truncation.
|
||||
template<typename INT>
|
||||
constexpr Integer(std::enable_if<std::is_integral_v<INT>, INT> n) {
|
||||
template<typename INT> constexpr Integer(INT n) {
|
||||
static_assert(std::is_integral_v<INT>);
|
||||
constexpr int nBits = CHAR_BIT * sizeof n;
|
||||
if constexpr (nBits < partBits) {
|
||||
if constexpr (std::is_unsigned_v<INT>) {
|
||||
|
|
Loading…
Reference in New Issue