57 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3! C755 The same proc-component-attr-spec shall not appear more than once in a 4! given proc-component-def-stmt.5! C759 PASS and NOPASS shall not both appear in the same 6! proc-component-attr-spec-list.7!8! R741 proc-component-def-stmt ->9! PROCEDURE ( [proc-interface] ) , proc-component-attr-spec-list10! :: proc-decl-list11! proc-component-attr-spec values are:12! PUBLIC, PRIVATE, NOPASS, PASS, POINTER13 14 type :: procComponentType15 !WARNING: Attribute 'PUBLIC' cannot be used more than once [-Wredundant-attribute]16 procedure(publicProc), public, pointer, public :: publicField17 !WARNING: Attribute 'PRIVATE' cannot be used more than once [-Wredundant-attribute]18 procedure(privateProc), private, pointer, private :: privateField19 !WARNING: Attribute 'NOPASS' cannot be used more than once [-Wredundant-attribute]20 procedure(nopassProc), nopass, pointer, nopass :: noPassField21 !WARNING: Attribute 'PASS' cannot be used more than once [-Wredundant-attribute]22 procedure(passProc), pass, pointer, pass :: passField23 !ERROR: Attributes 'PASS' and 'NOPASS' conflict with each other24 procedure(passNopassProc), pass, pointer, nopass :: passNopassField25 !WARNING: Attribute 'POINTER' cannot be used more than once [-Wredundant-attribute]26 procedure(pointerProc), pointer, public, pointer :: pointerField27 !ERROR: Procedure component 'nonpointerfield' must have POINTER attribute28 procedure(publicProc), public :: nonpointerField29 contains30 procedure :: noPassProc31 procedure :: passProc32 procedure :: passNopassProc33 procedure :: publicProc34 procedure :: privateProc35 end type procComponentType36 37contains38 subroutine publicProc(arg)39 class(procComponentType) :: arg40 end41 subroutine privateProc(arg)42 class(procComponentType) :: arg43 end44 subroutine noPassProc(arg)45 class(procComponentType) :: arg46 end47 subroutine passProc(arg)48 class(procComponentType) :: arg49 end50 subroutine passNopassProc(arg)51 class(procComponentType) :: arg52 end53 subroutine pointerProc(arg)54 class(procComponentType) :: arg55 end56end module m57