39 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! C722 A function name shall not be declared with an asterisk type-param-value 3! unless it is of type CHARACTER and is the name of a dummy function or the 4! name of the result of an external function.5subroutine s()6 7 type derived(param)8 integer, len :: param9 end type10 type(derived(34)) :: a11 12 procedure(character(len=*)) :: externCharFunc13 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, character named constant, or external function result14 procedure(type(derived(param =*))) :: externDerivedFunc15 16 interface17 subroutine subr(dummyFunc)18 character(len=*) :: dummyFunc19 end subroutine subr20 end interface21 22 contains23 function works()24 type(derived(param=4)) :: works25 end function works26 27 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, character named constant, or external function result28 function fails1()29 character(len=*) :: fails130 end function fails131 32 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, character named constant, or external function result33 function fails2()34 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, character named constant, or external function result35 type(derived(param=*)) :: fails236 end function fails237 38end subroutine s39