diff options
author | Peter Klausler <35819229+klausler@users.noreply.github.com> | 2024-02-23 19:15:32 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 21:15:32 -0600 |
commit | 31ab2c4f616d686c06e9b573c8f1a4ae7ad2d8c3 (patch) | |
tree | ecb4fdd6403bf5da61a0f5c726d6081e82238e8a | |
parent | bfcf7a0707592ccc7fd9e805aeb36c4da3f315a6 (diff) | |
download | llvm-31ab2c4f616d686c06e9b573c8f1a4ae7ad2d8c3.zip llvm-31ab2c4f616d686c06e9b573c8f1a4ae7ad2d8c3.tar.gz llvm-31ab2c4f616d686c06e9b573c8f1a4ae7ad2d8c3.tar.bz2 |
[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 https://github.com/llvm/llvm-project/issues/82574.
-rw-r--r-- | flang/lib/Semantics/resolve-names.cpp | 2 | ||||
-rw-r--r-- | flang/test/Semantics/namelist01.f90 | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp index 36deab9..0cbe0b4 100644 --- a/flang/lib/Semantics/resolve-names.cpp +++ b/flang/lib/Semantics/resolve-names.cpp @@ -6061,7 +6061,7 @@ void DeclarationVisitor::FinishNamelists() { if (!symbol) { symbol = &MakeSymbol(name, ObjectEntityDetails{}); ApplyImplicitRules(*symbol); - } else if (!ConvertToObjectEntity(*symbol)) { + } else if (!ConvertToObjectEntity(symbol->GetUltimate())) { SayWithDecl(name, *symbol, "'%s' is not a variable"_err_en_US); context().SetError(*groupSymbol); } diff --git a/flang/test/Semantics/namelist01.f90 b/flang/test/Semantics/namelist01.f90 index b14bf04..b93d4b2 100644 --- a/flang/test/Semantics/namelist01.f90 +++ b/flang/test/Semantics/namelist01.f90 @@ -11,6 +11,7 @@ subroutine C8103a(x) integer :: x !ERROR: 'dupname' is already declared in this scoping unit namelist /dupName/ x, x + namelist /nl/ uniquename ! ok end subroutine C8103a subroutine C8103b(y) |