When an attribute specification statement follows a declaration that applies the SAVE attribute to a symbol, name resolution can produce a spurious error message about redundant SAVEs. Fixes llvm-test-suite/Fortran/gfortran/regression/proc_ptr_9.f90.
17 lines
471 B
Fortran
17 lines
471 B
Fortran
! RUN: %flang_fc1 -fsyntax-only %s 2>&1 | FileCheck %s
|
|
! Check warning on multiple SAVE attribute specifications
|
|
subroutine saves
|
|
save x
|
|
save y
|
|
!CHECK: SAVE attribute was already specified on 'y'
|
|
integer, save :: y
|
|
integer, save :: z
|
|
!CHECK: SAVE attribute was already specified on 'x'
|
|
!CHECK: SAVE attribute was already specified on 'z'
|
|
save x,z
|
|
save :: p
|
|
procedure() :: p
|
|
!CHECK-NOT: SAVE attribute was already specified on 'p'
|
|
pointer :: p
|
|
end
|