http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55638
Bug #: 55638
Summary: Wrongly accepts INTENT + VALUE - and wrongly requires
it for PURE
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: accepts-invalid, rejects-valid
Severity: normal
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
"C558 An entity with the VALUE attribute shall not have the ALLOCATABLE,
INTENT (INOUT), INTENT(OUT), POINTER, or VOLATILE attributes." (F2008)
"C1276 The specification-part of a pure function subprogram shall specify that
all its nonpointer dummy data objects have the INTENT (IN) or the VALUE
attribute."
However, gfortran allows to combine INTENT with VALUE.
Additionally, for PURE (and PURE ELEMENTAL) procedures, it even requires the
INTENT besides the VALUE. Namely:
elemental subroutine foo(x,y)
1
Error: Argument 'y' of elemental procedure 'foo' at (1) must have its INTENT
specified
elemental subroutine foo(x,y)
integer, intent(inout) :: x
! integer, VALUE, INTENT(in) :: y
integer, VALUE :: y
x = y
end subroutine foo