Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Downgrade error message to warning #108115

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1587,8 +1587,11 @@ void CheckHelper::CheckExternal(const Symbol &symbol) {
} else if (!globalChars->CanBeCalledViaImplicitInterface() &&
context_.ShouldWarn(
common::UsageWarning::ExternalInterfaceMismatch)) {
msg = messages_.Say(
"The global subprogram '%s' may not be referenced via the implicit interface '%s'"_err_en_US,
// TODO: This should be a hard error if the procedure has
// actually been called (as opposed to just being used as a
// procedure pointer target or passed as an actual argument).
msg = WarnIfNotInModuleFile(
"The global subprogram '%s' should not be referenced via the implicit interface '%s'"_warn_en_US,
global->name(), symbol.name());
}
}
Expand Down
8 changes: 4 additions & 4 deletions flang/test/Semantics/local-vs-global.f90
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ program test
external module_before_1
!WARNING: The global entity 'block_data_before_1' corresponding to the local procedure 'block_data_before_1' is not a callable subprogram
external block_data_before_1
!ERROR: The global subprogram 'explicit_before_1' may not be referenced via the implicit interface 'explicit_before_1'
!WARNING: The global subprogram 'explicit_before_1' should not be referenced via the implicit interface 'explicit_before_1'
external explicit_before_1
external implicit_before_1
!ERROR: The global subprogram 'explicit_func_before_1' may not be referenced via the implicit interface 'explicit_func_before_1'
!WARNING: The global subprogram 'explicit_func_before_1' should not be referenced via the implicit interface 'explicit_func_before_1'
external explicit_func_before_1
external implicit_func_before_1
!WARNING: The global entity 'module_after_1' corresponding to the local procedure 'module_after_1' is not a callable subprogram
external module_after_1
!WARNING: The global entity 'block_data_after_1' corresponding to the local procedure 'block_data_after_1' is not a callable subprogram
external block_data_after_1
!ERROR: The global subprogram 'explicit_after_1' may not be referenced via the implicit interface 'explicit_after_1'
!WARNING: The global subprogram 'explicit_after_1' should not be referenced via the implicit interface 'explicit_after_1'
external explicit_after_1
external implicit_after_1
!ERROR: The global subprogram 'explicit_func_after_1' may not be referenced via the implicit interface 'explicit_func_after_1'
!WARNING: The global subprogram 'explicit_func_after_1' should not be referenced via the implicit interface 'explicit_func_after_1'
external explicit_func_after_1
external implicit_func_after_1
call module_before_1
Expand Down
Loading