COMMON block checks are split between name resolution and declaration checking. We generally want declaration checks to take place after name resolution, and the COMMON block checks that are currently in name resolution have some derived type analyses that are redundant with the derived type component iteration framework used elsewhere in semantics. So move as much as possible into declaration checking, use the component iteration framework, and cope with the missing COMMON block name case that arises with blank COMMON when placing the error messages.
15 lines
392 B
Fortran
15 lines
392 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
pointer(p,x)
|
|
!ERROR: Cray pointee 'y' may not be a member of an EQUIVALENCE group
|
|
pointer(p,y)
|
|
!ERROR: Cray pointee 'x' may not be a member of COMMON block //
|
|
common x
|
|
equivalence(y,z)
|
|
!ERROR: Cray pointee 'v' may not be initialized
|
|
real :: v = 42.0
|
|
pointer(p,v)
|
|
!ERROR: Cray pointee 'u' may not have the SAVE attribute
|
|
save u
|
|
pointer(p, u)
|
|
end
|