Files
clang-p2996/flang/test/Semantics/resolve107.f90
Peter Klausler 5bd87e65d6 [flang] Silence spurious errors about SAVE (#78765)
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.
2024-01-25 15:33:26 -08:00

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