-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[flang] Ensure USE-associated objects can be in NAMELIST #82846
Conversation
The name resolution for NAMELIST objects didn't allow for symbols that are not ObjectEntityDetails symbols. Fixes llvm#82574.
@llvm/pr-subscribers-flang-semantics Author: Peter Klausler (klausler) ChangesThe name resolution for NAMELIST objects didn't allow for symbols that are not ObjectEntityDetails symbols. Fixes #82574. Full diff: https://github.com/llvm/llvm-project/pull/82846.diff 2 Files Affected:
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 36deab969456d0..0cbe0b492fa44a 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 b14bf04ac91f90..b93d4b25550e33 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)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified.
Did you just merge another person's PR without permission??!? |
I have merge permission. |
Don't do that with my PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All builds and tests correctly and looks good.
I see what you mean now. Sorry about that. |
The name resolution for NAMELIST objects didn't allow for symbols that are not ObjectEntityDetails symbols.
Fixes #82574.