[flang][OpenACC] Fix false DEFAULT(NONE) error for named DO loop construct names (#189204)

In OpenACC semantic checking filter out symbols with MiscDetails, which
include construct names, scope names, complex part designators, type
parameter inquiries, etc.
This commit is contained in:
Eugene Epshteyn 2026-03-29 15:49:44 -04:00 committed by GitHub
parent 5b1be75929
commit cb017fd1b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -1833,7 +1833,7 @@ void AccAttributeVisitor::Post(const parser::Name &name) {
const Symbol &symbol{name.symbol->GetUltimate()};
if (!symbol.owner().IsDerivedType() && !symbol.has<ProcEntityDetails>() &&
!symbol.has<SubprogramDetails>() && !IsObjectWithVisibleDSA(symbol) &&
!symbol.has<AssocEntityDetails>()) {
!symbol.has<AssocEntityDetails>() && !symbol.has<MiscDetails>()) {
if (Symbol * found{currScope().FindSymbol(name.source)}) {
if (&symbol != found) {
// adjust the symbol within the region

View File

@ -221,4 +221,11 @@ subroutine acc_parallel_default_none
end do
!$acc end parallel
!$acc end data
! Named DO loop construct name should not be flagged by default(none).
!$acc parallel loop firstprivate(l) copyin(a) default(none)
outer: do i = 1, l
a(1,i) = 1
end do outer
!$acc end parallel
end subroutine acc_parallel_default_none