[flang] Improved the implementation of "IsCoarray()" suggested by @tskeith.
authorPeter Steinfeld <psteinfeld@nvidia.com>
Wed, 3 Jul 2019 20:49:12 +0000 (13:49 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Wed, 3 Jul 2019 20:59:44 +0000 (13:59 -0700)
Original-commit: flang-compiler/f18@efaf5fca2e5acabd052eb6e4962aa92ce29aa2d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/542

flang/lib/semantics/tools.cc

index f994e05..d2adc6f 100644 (file)
@@ -402,8 +402,7 @@ bool IsFinalizable(const Symbol &symbol) {
 }
 
 bool IsCoarray(const Symbol &symbol) {
-  const auto *details{symbol.detailsIf<ObjectEntityDetails>()};
-  return details && details->IsCoarray();
+  return symbol.Corank() > 0;
 }
 
 bool IsAssumedSizeArray(const Symbol &symbol) {