libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / dummy_optional_arg.f90
blob4c0417bffc0914f89ef93cc6f9ad89cc290ee7ab
1 ! { dg-do compile }
2 ! PR fortran/45495
4 ! Code originally submitted by Philip Mason <pmason at ricardo dot com>
6 function jack(aa)
7 character(len=*), intent(in) :: aa
8 optional :: aa
9 character(len=len(aa)+1) :: jack ! { dg-error "cannot be OPTIONAL" }
10 jack = ''
11 end function jack
13 function diane(aa)
14 character(len=*), intent(out) :: aa
15 character(len=len(aa)+1) :: diane
16 diane = '012345678901'
17 aa = 'abcdefghijklmn'
18 end function diane