Skip to content
Snippets Groups Projects
Commit 8f414316 authored by Peter Steinfeld's avatar Peter Steinfeld
Browse files

[flang] Disallow BOZ literal constants as arguments of implicit interfaces

Since BOZ literal arguments are typeless, we cannot know how to pass them as
actual arguments to procedures with implicit interfaces.  This change avoids
the problem by emitting an error message in such situations.

This change stemmed from the following issue --
  https://github.com/flang-compiler/f18-llvm-project/issues/794

Differential Revision: https://reviews.llvm.org/D106831
parent c658b472
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,9 @@ static void CheckImplicitInterfaceArg(
}
}
if (const auto *expr{arg.UnwrapExpr()}) {
if (std::holds_alternative<evaluate::BOZLiteralConstant>(expr->u)) {
messages.Say("BOZ argument requires an explicit interface"_err_en_US);
}
if (auto named{evaluate::ExtractNamedEntity(*expr)}) {
const Symbol &symbol{named->GetLastSymbol()};
if (symbol.Corank() > 0) {
......
......@@ -77,4 +77,7 @@ subroutine bozchecks
res = MERGE_BITS(B"1101",3,B"1011")
res = REAL(B"1101")
!ERROR: BOZ argument requires an explicit interface
call implictSub(Z'12345')
end subroutine
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment