Skip to content
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
2 changes: 1 addition & 1 deletion flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ void CheckHelper::CheckExternal(const Symbol &symbol) {
if (auto previousChars{Characterize(previous)}) {
std::string whyNot;
if (!chars->IsCompatibleWith(*previousChars,
/*ignoreImplicitVsExplicit=*/false, &whyNot)) {
/*ignoreImplicitVsExplicit=*/true, &whyNot)) {
if (auto *msg{Warn(common::UsageWarning::ExternalInterfaceMismatch,
"The external interface '%s' is not compatible with an earlier definition (%s)"_warn_en_US,
symbol.name(), whyNot)}) {
Expand Down
21 changes: 21 additions & 0 deletions flang/test/Semantics/bug1491.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
!RUN: %python %S/test_errors.py %s %flang_fc1 -Werror -pedantic
module m
interface
integer function foo1()
end function
integer function foo2(j)
end function
integer function foo3()
end function
end interface
end module

subroutine test()
integer, external :: foo1
!WARNING: The external interface 'foo2' is not compatible with an earlier definition (distinct numbers of dummy arguments) [-Wexternal-interface-mismatch]
integer, external :: foo2
integer, external :: foo3
call bar(foo1())
call bar(foo2())
call baz(foo3)
end subroutine
2 changes: 1 addition & 1 deletion flang/test/Semantics/null-init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module m6

module m7
interface
!WARNING: The external interface 'null' is not compatible with an earlier definition (incompatible procedure attributes: ImplicitInterface) [-Wexternal-interface-mismatch]
!WARNING: The external interface 'null' is not compatible with an earlier definition (function results have incompatible attributes) [-Wexternal-interface-mismatch]
function null() result(p)
integer, pointer :: p
end function
Expand Down