[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.
This commit is contained in:
Peter Klausler 2024-01-17 14:03:47 -08:00 committed by GitHub
parent 03e43cf1c7
commit 345c1ea881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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