mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 23:36:40 +00:00
[flang] Catch untyped entities in interfaces with IMPLICIT NONE (#109018)
The order of operations in name resolution wasn't converting named entities to objects by the time that they were subjected to the implicit typing rules in the case of interface blocks. This led to entities remaining untyped without error, leading to a crash in module file generation. Fixes https://github.com/llvm/llvm-project/issues/108975.
This commit is contained in:
parent
5f11d38d01
commit
1e19e1e1a4
@ -8748,6 +8748,9 @@ void ResolveNamesVisitor::FinishSpecificationPart(
|
||||
CheckImports();
|
||||
for (auto &pair : currScope()) {
|
||||
auto &symbol{*pair.second};
|
||||
if (inInterfaceBlock()) {
|
||||
ConvertToObjectEntity(symbol);
|
||||
}
|
||||
if (NeedsExplicitType(symbol)) {
|
||||
ApplyImplicitRules(symbol);
|
||||
}
|
||||
|
12
flang/test/Semantics/implicit16.f90
Normal file
12
flang/test/Semantics/implicit16.f90
Normal file
@ -0,0 +1,12 @@
|
||||
! RUN: %python %S/test_errors.py %s %flang_fc1
|
||||
interface
|
||||
!ERROR: No explicit type declared for 'a'
|
||||
subroutine s(a)
|
||||
implicit none
|
||||
end
|
||||
!ERROR: No explicit type declared for 'f'
|
||||
function f()
|
||||
implicit none
|
||||
end
|
||||
end interface
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user