[flang-commits] [flang] [flang] Avoid new spurious error under -fopenacc (PR #78504)

via flang-commits flang-commits at lists.llvm.org
Wed Jan 17 13:28:15 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-openmp

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

Don't create HostAssocDetails symbols for subprograms in OpenACC regions; it can cause warnings to became errors later in compilation when calls do not appear to be to external procedures with implicit interfaces.

---
Full diff: https://github.com/llvm/llvm-project/pull/78504.diff


1 Files Affected:

- (modified) flang/lib/Semantics/resolve-directives.cpp (+1-1) 


``````````diff
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index b30b81cf90c951..e31193f490f79a 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -1313,7 +1313,7 @@ void AccAttributeVisitor::Post(const parser::Name &name) {
   auto *symbol{name.symbol};
   if (symbol && !dirContext_.empty() && GetContext().withinConstruct) {
     if (!symbol->owner().IsDerivedType() && !symbol->has<ProcEntityDetails>() &&
-        !IsObjectWithDSA(*symbol)) {
+        !symbol->has<SubprogramDetails>() && !IsObjectWithDSA(*symbol)) {
       if (Symbol * found{currScope().FindSymbol(name.source)}) {
         if (symbol != found) {
           name.symbol = found; // adjust the symbol within region

``````````

</details>


https://github.com/llvm/llvm-project/pull/78504


More information about the flang-commits mailing list