Skip to content

Commit 31ab2c4

Browse files
authored
[flang] Ensure USE-associated objects can be in NAMELIST (#82846)
The name resolution for NAMELIST objects didn't allow for symbols that are not ObjectEntityDetails symbols. Fixes #82574.
1 parent bfcf7a0 commit 31ab2c4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

flang/lib/Semantics/resolve-names.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6061,7 +6061,7 @@ void DeclarationVisitor::FinishNamelists() {
60616061
if (!symbol) {
60626062
symbol = &MakeSymbol(name, ObjectEntityDetails{});
60636063
ApplyImplicitRules(*symbol);
6064-
} else if (!ConvertToObjectEntity(*symbol)) {
6064+
} else if (!ConvertToObjectEntity(symbol->GetUltimate())) {
60656065
SayWithDecl(name, *symbol, "'%s' is not a variable"_err_en_US);
60666066
context().SetError(*groupSymbol);
60676067
}

flang/test/Semantics/namelist01.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ subroutine C8103a(x)
1111
integer :: x
1212
!ERROR: 'dupname' is already declared in this scoping unit
1313
namelist /dupName/ x, x
14+
namelist /nl/ uniquename ! ok
1415
end subroutine C8103a
1516

1617
subroutine C8103b(y)

0 commit comments

Comments
 (0)