2 ! { dg-options "-std=f95" }
7 ! ------------ INVALID ONE ------------------------
20 integer function sub()
25 ! Note: The following is formally valid as long as "t" is not used.
26 ! For simplicity, -std=f95 will give an error.
27 ! It is unlikely that a real-world program is rejected with -std=f95
30 use m
! { dg-error "Fortran 2003: Generic name 't' of function 'sub' at .1. being the same name as derived type at" }
31 use m2
! { dg-error "Fortran 2003: Generic name 't' of function 'sub' at .1. being the same name as derived type at" }
32 ! i = sub() ! << Truly invalid in F95, valid in F2003
35 ! ------------ INVALID TWO ------------------------
38 type t2
! { dg-error "Fortran 2003: Generic name 't2' of function 'sub2' at .1. being the same name as derived type at" }
45 integer function sub2() ! { dg-error "Fortran 2003: Generic name 't2' of function 'sub2' at .1. being the same name as derived type at" }