[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve47.f90
blobb839cf9c5019d3a945ae22b28ca4afee521a2b6c
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 module m1
3 !ERROR: Logical constant '.true.' may not be used as a defined operator
4 interface operator(.TRUE.)
5 end interface
6 !ERROR: Logical constant '.false.' may not be used as a defined operator
7 generic :: operator(.false.) => bar
8 end
10 module m2
11 interface operator(+)
12 module procedure foo
13 end interface
14 interface operator(.foo.)
15 module procedure foo
16 end interface
17 interface operator(.ge.)
18 module procedure bar
19 end interface
20 contains
21 integer function foo(x, y)
22 logical, intent(in) :: x, y
23 foo = 0
24 end
25 logical function bar(x, y)
26 complex, intent(in) :: x, y
27 bar = .false.
28 end
29 end
31 !ERROR: Intrinsic operator '.le.' may not be used as a defined operator
32 use m2, only: operator(.le.) => operator(.ge.)
33 !ERROR: Intrinsic operator '.not.' may not be used as a defined operator
34 use m2, only: operator(.not.) => operator(.foo.)
35 !ERROR: Logical constant '.true.' may not be used as a defined operator
36 use m2, only: operator(.true.) => operator(.foo.)
37 end