[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gfortran.dg / sizeof_proc.f90
blob0a63537888df8181e45b5bc6806e6788ab11d4e3
1 ! { dg-do compile }
3 ! PR 47023: C_Sizeof: Rejects valid code
5 ! Contributed by Janus Weil <janus@gcc.gnu.org>
7 use iso_c_binding
8 procedure(real) :: proc
9 procedure(real), pointer :: pp
10 pp => sin
12 print *,sizeof(proc) ! { dg-error "shall not be a procedure" }
13 print *,sizeof(pp) ! { dg-error "shall not be a procedure" }
14 print *,sizeof(pp(0.))
15 print *,sizeof(sub) ! { dg-error "shall not be a procedure" }
16 print *,sizeof(func) ! { dg-error "shall not be a procedure" }
17 print *,sizeof(func())
19 contains
21 subroutine sub
22 end subroutine
24 real function func()
25 func = 0.
26 end function
28 end