[flang-commits] [PATCH] D87073: [flang]Fix for PR47339

Inderjeet via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Sep 3 17:34:00 PDT 2020


inderjeet-hcl added inline comments.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:5049
+    const MaybeExpr *pexpr{&details.expr()};
+    if (!*pexpr) {
+      pexpr = &GetCurrentAssociation().selector.expr;
----------------
klausler wrote:
> If `details.expr()` is vacant, so will `GetCurrentAssociation().selector.expr` be, yes?  I think that you can use one or the other.  This would be shorter:
> 
> ```
> if (ExtractCoarrayRef(GetCurrentAssociation().selector.expr)) { // C1103
>   Say(...);
> }
> ```
I agree, I will update code to pass GetCurrentAssociation().selector.expr directly to function ExtractCoarrayRef.
I used additional checks here as similar code was present in function SetTypeFromAssociation(Symbol &symbol). It seems SetTypeFromAssociation needs additional checks as it is getting called from other locations also.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87073/new/

https://reviews.llvm.org/D87073



More information about the flang-commits mailing list