[flang] Fix call to CHECK() on erroneous subroutine declaration
When processing declarations in resolve-names.cpp, we were returning a symbol that had SubprogramName details to PushSubprogramScope(), which expects a symbol with Subprogram details. I adjusted the code and added a test. Differential Revision: https://reviews.llvm.org/D89829
This commit is contained in:
parent
296314516d
commit
29d838310d
|
@ -3048,7 +3048,8 @@ Symbol *SubprogramVisitor::GetSpecificFromGeneric(const parser::Name &name) {
|
|||
details->set_specific(Resolve(name, *specific));
|
||||
} else if (isGeneric()) {
|
||||
SayAlreadyDeclared(name, *specific);
|
||||
} else if (!specific->has<SubprogramDetails>()) {
|
||||
}
|
||||
if (!specific->has<SubprogramDetails>()) {
|
||||
specific->set_details(SubprogramDetails{});
|
||||
}
|
||||
return specific;
|
||||
|
|
|
@ -22,3 +22,14 @@ module m2
|
|||
end subroutine
|
||||
end interface
|
||||
end module
|
||||
|
||||
module m3
|
||||
interface s
|
||||
subroutine s
|
||||
end
|
||||
end interface
|
||||
contains
|
||||
!ERROR: 's' is already declared in this scoping unit
|
||||
subroutine s
|
||||
end subroutine
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue