public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/55638] New: Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE
@ 2012-12-10 11:42 burnus at gcc dot gnu.org
  2012-12-14 16:57 ` [Bug fortran/55638] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-10 11:42 UTC (permalink / raw)
  To: gcc-bugs


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: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


"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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/55638] Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE
  2012-12-10 11:42 [Bug fortran/55638] New: Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE burnus at gcc dot gnu.org
@ 2012-12-14 16:57 ` burnus at gcc dot gnu.org
  2012-12-15 23:26 ` burnus at gcc dot gnu.org
  2012-12-16 10:54 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-14 16:57 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55638

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-14 16:56:59 UTC ---
Fortran 2008 Corr 1 has the following wording; otherwise, the intent would be
needed for IMPURE ELEMENTAL:

"C1290a The specification-part of an elemental subprogram shall specify the
intents of all of its dummy arguments that do not have the VALUE attribut"


As C558 implies, VALUE, INTENT(IN) is okay; the value+intent check works
correctly (cf. symbol.c). Sorry for claiming otherwise.

Patch: http://gcc.gnu.org/ml/fortran/2012-12/msg00082.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/55638] Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE
  2012-12-10 11:42 [Bug fortran/55638] New: Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE burnus at gcc dot gnu.org
  2012-12-14 16:57 ` [Bug fortran/55638] " burnus at gcc dot gnu.org
@ 2012-12-15 23:26 ` burnus at gcc dot gnu.org
  2012-12-16 10:54 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-15 23:26 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55638

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-15 23:25:41 UTC ---
Author: burnus
Date: Sat Dec 15 23:25:36 2012
New Revision: 194525

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194525
Log:
2012-12-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55638
        * resolve.c (resolve_formal_arglist): Allow VALUE without
        INTENT for ELEMENTAL procedures.

2012-12-16  Tobias Burnus  <burnus@net-b.de>

        PR fortran/55638
        * gfortran.dg/elemental_args_check_3.f90: Update dg-error.
        * gfortran.dg/elemental_args_check_7.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/elemental_args_check_7.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/elemental_args_check_3.f90


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/55638] Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE
  2012-12-10 11:42 [Bug fortran/55638] New: Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE burnus at gcc dot gnu.org
  2012-12-14 16:57 ` [Bug fortran/55638] " burnus at gcc dot gnu.org
  2012-12-15 23:26 ` burnus at gcc dot gnu.org
@ 2012-12-16 10:54 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2012-12-16 10:54 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55638

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-16 10:54:36 UTC ---
FIXED on the 4.8 trunk.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-16 10:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-10 11:42 [Bug fortran/55638] New: Wrongly accepts INTENT + VALUE - and wrongly requires it for PURE burnus at gcc dot gnu.org
2012-12-14 16:57 ` [Bug fortran/55638] " burnus at gcc dot gnu.org
2012-12-15 23:26 ` burnus at gcc dot gnu.org
2012-12-16 10:54 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).