diff --git a/flang/lib/Semantics/symbol.cpp b/flang/lib/Semantics/symbol.cpp --- a/flang/lib/Semantics/symbol.cpp +++ b/flang/lib/Semantics/symbol.cpp @@ -201,6 +201,14 @@ specificProcs_.push_back(symbol); } } + for (const SourceName &sourceName : from.bindingNames_) { + if (std::find_if(bindingNames_.begin(), bindingNames_.end(), + [&](const SourceName &mySource) { + return &mySource == &sourceName; + }) == bindingNames_.end()) { + bindingNames_.push_back(sourceName); + } + } } // The name of the kind of details for this symbol. diff --git a/flang/test/Semantics/resolve53.f90 b/flang/test/Semantics/resolve53.f90 --- a/flang/test/Semantics/resolve53.f90 +++ b/flang/test/Semantics/resolve53.f90 @@ -457,3 +457,26 @@ integer :: i, j end end + +module m20 + interface operator(.not.) + real function f(x) + character(*),intent(in) :: x + end function + end interface + interface operator(+) + procedure f + end interface +end module + +subroutine s1() + use m20 + interface operator(.not.) + !ERROR: Procedure 'f' is already specified in generic 'operator(.not.)' + procedure f + end interface + interface operator(+) + !ERROR: Procedure 'f' is already specified in generic 'operator(+)' + procedure f + end interface +end subroutine s1