brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 6335417 Raw
97 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m13  type, abstract :: ta14   contains5    procedure(ta1p1), deferred :: ta1p16    generic :: gen => ta1p17  end type8  abstract interface9    subroutine ta1p1(x)10      import ta111      class(ta1), intent(in) :: x12    end13  end interface14  type :: tb115   contains16    procedure tb1p117    generic :: gen => tb1p118  end type19  type :: tc120   contains21    procedure tc1p122    generic, private :: gen => tc1p123  end type24  type :: td125   contains26    procedure, nopass :: td1p127    generic :: gen => td1p128  end type29 contains30  subroutine tb1p1(x)31    class(tb1), intent(in) :: x32  end33  subroutine tb1p2(x)34    class(tb1), intent(in) :: x35  end36  subroutine tc1p1(x)37    class(tc1), intent(in) :: x38  end39  subroutine td1p140  end41end42 43module m244  use m145  type, extends(ta1) :: ta2a46   contains47    procedure :: ta1p1 => ta2ap1 ! ok48  end type49  type, extends(ta1) :: ta2b50   contains51    procedure :: ta1p1 => ta2bp152    generic :: gen => ta1p1 ! ok, overidden deferred53  end type54  type, extends(tb1) :: tb2a55   contains56    generic :: gen => tb1p1 ! ok, same binding57  end type58  type, extends(tb1) :: tb2b59   contains60    procedure :: tb1p1 => tb2bp261    generic :: gen => tb1p1 ! ok, overridden62  end type63  type, extends(tb1) :: tb2c64   contains65    procedure tb2cp166    !ERROR: Generic 'gen' may not have specific procedures 'tb1p1' and 'tb2cp1' as their interfaces are not distinguishable67    generic :: gen => tb2cp168  end type69  type, extends(tc1) :: tc270   contains71    procedure tc2p172    !ERROR: 'gen' does not have the same accessibility as its previous declaration73    generic :: gen => tc2p174  end type75  type, extends(td1) :: td276   contains77    procedure, nopass :: td2p1 => td1p178    generic :: gen => td2p1 ! ok, same procedure79  end type80 contains81  subroutine ta2ap1(x)82    class(ta2a), intent(in) :: x83  end84  subroutine ta2bp1(x)85    class(ta2b), intent(in) :: x86  end87  subroutine tb2bp2(x)88    class(tb2b), intent(in) :: x89  end90  subroutine tb2cp1(x)91    class(tb2c), intent(in) :: x92  end93  subroutine tc2p1(x)94    class(tc2), intent(in) :: x95  end96end97