Skip to content

Commit b36b249

Browse files
committed
[flang] Silence inappropriate error message
A recent patch added better compatibility checking for actual procedure arguments, but it has led to a few failures in the Fujitsu Fortran test suite in cases of NULL() actual arguments being associated with dummy procedure pointers. As is the case with dummy data pointers, these must always be accepted. Fixes Fujitsu Fortran test cases 0249_0023 through 0028 and 0387_0047.
1 parent b0a4b5b commit b36b249

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

flang/lib/Semantics/expression.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,6 +2536,15 @@ static bool CheckCompatibleArgument(bool isElemental,
25362536
return false;
25372537
},
25382538
[&](const characteristics::DummyProcedure &dummy) {
2539+
if ((dummy.attrs.test(
2540+
characteristics::DummyProcedure::Attr::Optional) ||
2541+
dummy.attrs.test(
2542+
characteristics::DummyProcedure::Attr::Pointer)) &&
2543+
IsBareNullPointer(expr)) {
2544+
// NULL() is compatible with any dummy pointer
2545+
// or optional dummy procedure.
2546+
return true;
2547+
}
25392548
if (!expr || !IsProcedurePointerTarget(*expr)) {
25402549
return false;
25412550
}

0 commit comments

Comments
 (0)