mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 15:26:41 +00:00

Generic operator/assignment checks for distinguishable specific procedures must ignore inaccessible generic bindings. Fixes https://github.com/llvm/llvm-project/issues/122764.
31 lines
787 B
Fortran
31 lines
787 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
module m
|
|
type t
|
|
contains
|
|
procedure :: tweedledee
|
|
generic :: operator(.ga.) => tweedledee
|
|
generic, private :: operator(.gb.) => tweedledee
|
|
end type
|
|
interface operator(.gc.)
|
|
module procedure tweedledum
|
|
end interface
|
|
contains
|
|
integer function tweedledee(x,y)
|
|
class(t), intent(in) :: x, y
|
|
tweedledee = 1
|
|
end
|
|
integer function tweedledum(x,y)
|
|
class(t), intent(in) :: x, y
|
|
tweedledum = 2
|
|
end
|
|
end
|
|
|
|
module badDueToAccessibility
|
|
!ERROR: Generic 'OPERATOR(.ga.)' may not have specific procedures 'tweedledum' and 't%tweedledee' as their interfaces are not distinguishable
|
|
use m, operator(.ga.) => operator(.gc.)
|
|
end
|
|
|
|
module goodDueToInaccessibility
|
|
use m, operator(.gb.) => operator(.gc.)
|
|
end
|