[flang] Accept polymorphic component element in storage_size
[llvm-project.git] / flang / test / Semantics / resolve74.f90
blob14d1c8a29b867605d6add6639a26425d34c1578c
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! 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.
5 subroutine s()
7 type derived(param)
8 integer, len :: param
9 end type
10 type(derived(34)) :: a
12 procedure(character(len=*)) :: externCharFunc
13 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, named constant, or external function result
14 procedure(type(derived(param =*))) :: externDerivedFunc
16 interface
17 subroutine subr(dummyFunc)
18 character(len=*) :: dummyFunc
19 end subroutine subr
20 end interface
22 contains
23 function works()
24 type(derived(param=4)) :: works
25 end function works
27 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, named constant, or external function result
28 function fails1()
29 character(len=*) :: fails1
30 end function fails1
32 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, named constant, or external function result
33 function fails2()
34 !ERROR: An assumed (*) type parameter may be used only for a (non-statement function) dummy argument, associate name, named constant, or external function result
35 type(derived(param=*)) :: fails2
36 end function fails2
38 end subroutine s