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

via flang-commits flang-commits at lists.llvm.org
Wed Jan 17 14:03:51 PST 2024


Author: Peter Klausler
Date: 2024-01-17T14:03:47-08:00
New Revision: 345c1ea881012d84a10b3fe6c2c420dbf8e3ef31

URL: https://github.com/llvm/llvm-project/commit/345c1ea881012d84a10b3fe6c2c420dbf8e3ef31
DIFF: https://github.com/llvm/llvm-project/commit/345c1ea881012d84a10b3fe6c2c420dbf8e3ef31.diff

LOG: [flang] Avoid new spurious error under -fopenacc (#78504)

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.

Added: 
    

Modified: 
    flang/lib/Semantics/resolve-directives.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index b30b81cf90c9517..e31193f490f79a0 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


        


More information about the flang-commits mailing list