[flang] Fix issue flang-compiler/f18#267 (GetScalarConstantValue)
authorJean Perier <jperier@hsw1.pgi.net>
Thu, 24 Jan 2019 17:46:35 +0000 (09:46 -0800)
committerJean Perier <jperier@hsw1.pgi.net>
Thu, 24 Jan 2019 17:46:35 +0000 (09:46 -0800)
Original-commit: flang-compiler/f18@9fcbd09a51e935572e63bab6a5b30206375b24f6
Tree-same-pre-rewrite: false

flang/lib/evaluate/fold.h

index bdaa520..32155f6 100644 (file)
@@ -62,7 +62,7 @@ const Scalar<T> *GetScalarConstantValue(const Expr<T> &expr) {
 template<typename T>
 const Scalar<T> *GetScalarConstantValue(
     const Expr<SomeKind<T::category>> &expr) {
-  if (const auto *kindExpr{UnwrapExpr<Expr<T>>(expr.u)}) {
+  if (const auto *kindExpr{UnwrapExpr<Expr<T>>(expr)}) {
     return GetScalarConstantValue<T>(*kindExpr);
   }
   return nullptr;
@@ -70,7 +70,7 @@ const Scalar<T> *GetScalarConstantValue(
 
 template<typename T>
 const Scalar<T> *GetScalarConstantValue(const Expr<SomeType> &expr) {
-  if (const auto *kindExpr{UnwrapExpr<Expr<T>>(expr.u)}) {
+  if (const auto *kindExpr{UnwrapExpr<Expr<T>>(expr)}) {
     return GetScalarConstantValue<T>(*kindExpr);
   }
   return nullptr;