[flang] Don't check procedure pointer interface function result specification expressions

When a procedure pointer references a function as its interface, don't
apply semantic checks to the specification expressions that appear in
the declaration of the function's result -- this can lead to bogus
error messages as those specification expressions are being examined
out of their proper context.

Differential Revision: https://reviews.llvm.org/D131106
This commit is contained in:
Peter Klausler
2022-07-28 08:57:28 -07:00
parent 310962f25e
commit 525ff9bd20

View File

@@ -291,7 +291,11 @@ void CheckHelper::Check(const Symbol &symbol) {
canHaveAssumedParameter |= symbol.has<AssocEntityDetails>();
}
}
Check(*type, canHaveAssumedParameter);
if (IsProcedurePointer(symbol) && symbol.HasExplicitInterface()) {
// Don't check function result types here
} else {
Check(*type, canHaveAssumedParameter);
}
if (InPure() && InFunction() && IsFunctionResult(symbol)) {
if (derived && HasImpureFinal(*derived)) { // C1584
messages_.Say(