[flang-commits] [PATCH] D155970: [flang] Disallow ASYNCHRONOUS for subroutine

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jul 21 13:52:06 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG24445fc15ca4: [flang] Disallow ASYNCHRONOUS for subroutine (authored by klausler).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155970

Files:
  flang/lib/Semantics/check-declarations.cpp
  flang/test/Semantics/resolve20.f90


Index: flang/test/Semantics/resolve20.f90
===================================================================
--- flang/test/Semantics/resolve20.f90
+++ flang/test/Semantics/resolve20.f90
@@ -81,7 +81,9 @@
 contains
   subroutine bar
   end subroutine
+  !ERROR: An entity may not have the ASYNCHRONOUS attribute unless it is a variable
   subroutine test
+    asynchronous test
     !ERROR: Abstract procedure interface 'foo2' may not be referenced
     call foo2()
     !ERROR: Abstract procedure interface 'f' may not be referenced
Index: flang/lib/Semantics/check-declarations.cpp
===================================================================
--- flang/lib/Semantics/check-declarations.cpp
+++ flang/lib/Semantics/check-declarations.cpp
@@ -277,6 +277,12 @@
     CheckContiguous(symbol);
   }
   CheckGlobalName(symbol);
+  if (symbol.attrs().test(Attr::ASYNCHRONOUS) &&
+      !evaluate::IsVariable(symbol)) {
+    messages_.Say(
+        "An entity may not have the ASYNCHRONOUS attribute unless it is a variable"_err_en_US);
+  }
+
   if (isDone) {
     return; // following checks do not apply
   }
@@ -429,11 +435,6 @@
           symbol.name());
     }
   }
-  if (symbol.attrs().test(Attr::ASYNCHRONOUS) &&
-      !evaluate::IsVariable(symbol)) {
-    messages_.Say(
-        "An entity may not have the ASYNCHRONOUS attribute unless it is a variable"_err_en_US);
-  }
 }
 
 void CheckHelper::CheckCommonBlock(const Symbol &symbol) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155970.543052.patch
Type: text/x-patch
Size: 1450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230721/a60e9031/attachment-0001.bin>


More information about the flang-commits mailing list