public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25097]  New: better diagnostic needed
@ 2005-11-26 18:07 jv244 at cam dot ac dot uk
  2005-11-30 12:49 ` [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT eedelman at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 18:07 UTC (permalink / raw)
  To: gcc-bugs

using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic
-std=f95', I get a bad / no diagnostic for the following invalid code:

 MODULE M1
  TYPE T1
   INTEGER :: I
  END TYPE T1
 CONTAINS
  SUBROUTINE S1(D1)
   TYPE(T1), OPTIONAL :: D1
   write(6,*) PRESENT(D1%I)
  END SUBROUTINE S1
 END MODULE
 END


-- 
           Summary: better diagnostic needed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-30 12:49 ` eedelman at gcc dot gnu dot org
  2006-01-13 18:40 ` pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2005-11-30 12:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from eedelman at gcc dot gnu dot org  2005-11-30 12:49 -------
Confirmed.


-- 

eedelman at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-30 12:49:19
               date|                            |
            Summary|better diagnostic needed    |Component of optional
                   |                            |argument allowed as arg. to
                   |                            |PRESENT


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-30 12:49 ` [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT eedelman at gcc dot gnu dot org
@ 2006-01-13 18:40 ` pinskia at gcc dot gnu dot org
  2006-07-11 16:10 ` patchapp at dberlin dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-13 18:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-13 18:40 -------
It is not just derived types, it is also arrays too:
The following is invalid code and should be rejected.
      subroutine my_sio_file_write_common(data_c1)
        real,   intent(in), optional :: data_c1(4)
        if (present(data_c1(1))) then
        call abort()
        endif
      end subroutine my_sio_file_write_common

-------
Found this while looking into PR 25785.


-- 


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-30 12:49 ` [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT eedelman at gcc dot gnu dot org
  2006-01-13 18:40 ` pinskia at gcc dot gnu dot org
@ 2006-07-11 16:10 ` patchapp at dberlin dot org
  2006-07-13  5:08 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: patchapp at dberlin dot org @ 2006-07-11 16:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2006-07-11 16:10 -------
Subject: Bug number PR25097

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00476.html


-- 


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2006-07-11 16:10 ` patchapp at dberlin dot org
@ 2006-07-13  5:08 ` pault at gcc dot gnu dot org
  2006-07-16 17:18 ` pault at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-13  5:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pault at gcc dot gnu dot org  2006-07-13 05:07 -------
Subject: Bug 25097

Author: pault
Date: Thu Jul 13 05:07:35 2006
New Revision: 115410

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115410
Log:
2006-07-13  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/28174
        * trans-expr.c (gfc_conv_aliased_arg): Missing formal arg means
        that intent is INOUT (fixes regression).

        PR fortran/25097
        * check.c (check_present): The only permitted reference is a
        full array reference.

        PR fortran/20903
        * decl.c (variable_decl): Add error if a derived type is not
        from the current namespace if the namespace is an interface
        body.

2006-07-13  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/25097
        * gfortran.dg/present_1.f90: New test.

        PR fortran/20903
        * gfortran.dg/interface_derived_type_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/interface_derived_type_1.f90
    trunk/gcc/testsuite/gfortran.dg/present_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/check.c
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2006-07-13  5:08 ` pault at gcc dot gnu dot org
@ 2006-07-16 17:18 ` pault at gcc dot gnu dot org
  2006-07-16 17:21 ` pault at gcc dot gnu dot org
  2007-10-04 20:37 ` patchapp at dberlin dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-16 17:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2006-07-16 17:17 -------
Subject: Bug 25097

Author: pault
Date: Sun Jul 16 17:17:04 2006
New Revision: 115502

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115502
Log:
2006-07-16  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/28384
        * trans-common.c (translate_common): If common_segment is NULL
        emit error that common block does not exist.

        PR fortran/20844
        * io.c (check_io_constraints): It is an error if an ADVANCE
        specifier appears without an explicit format.

        PR fortran/28201
        * resolve.c (resolve_generic_s): For a use_associated function,
        do not search for an alternative symbol in the parent name
        space.

        PR fortran/20893
        * resolve.c (resolve_elemental_actual): New function t combine
        all the checks of elemental procedure actual arguments. In
        addition, check of array valued optional args(this PR) has
        been added.
        (resolve_function, resolve_call): Remove parts that treated
        elemental procedure actual arguments and call the above.

        PR fortran/28353
        * trans-expr.c (gfc_conv_aliased_arg): Missing formal arg means
        that intent is INOUT (fixes regression).

        PR fortran/25097
        * check.c (check_present): The only permitted reference is a
        full array reference.

        PR fortran/20903
        * decl.c (variable_decl): Add error if a derived type is not
        from the current namespace if the namespace is an interface
        body.

2006-07-16  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/20844
        * gfortran.dg/io_constaints_2.f90: Add the test for ADVANCE
        specifiers requiring an explicit format tag..

        PR fortran/28201
        * gfortran.dg/generic_5: New test.

        PR fortran/20893
        * gfortran.dg/elemental_optional_args_1.f90: New test.

        PR fortran/25097
        * gfortran.dg/present_1.f90: New test.

        PR fortran/20903
        * gfortran.dg/interface_derived_type_1.f90: New test.

Added:
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/elemental_optional_args_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/generic_5.f90
   
branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/interface_derived_type_1.f90
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/present_1.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/check.c
    branches/gcc-4_1-branch/gcc/fortran/decl.c
    branches/gcc-4_1-branch/gcc/fortran/io.c
    branches/gcc-4_1-branch/gcc/fortran/resolve.c
    branches/gcc-4_1-branch/gcc/fortran/trans-common.c
    branches/gcc-4_1-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/io_constraints_2.f90


-- 


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2006-07-16 17:18 ` pault at gcc dot gnu dot org
@ 2006-07-16 17:21 ` pault at gcc dot gnu dot org
  2007-10-04 20:37 ` patchapp at dberlin dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pault at gcc dot gnu dot org @ 2006-07-16 17:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pault at gcc dot gnu dot org  2006-07-16 17:21 -------
Fixed on trunk and 4.2

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT
  2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2006-07-16 17:21 ` pault at gcc dot gnu dot org
@ 2007-10-04 20:37 ` patchapp at dberlin dot org
  6 siblings, 0 replies; 8+ messages in thread
From: patchapp at dberlin dot org @ 2007-10-04 20:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from patchapp at dberlin dot org  2007-10-04 20:37 -------
Subject: Bug number PR 25097

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-10/msg00267.html


-- 


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


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

end of thread, other threads:[~2007-10-04 20:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 18:07 [Bug fortran/25097] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-30 12:49 ` [Bug fortran/25097] Component of optional argument allowed as arg. to PRESENT eedelman at gcc dot gnu dot org
2006-01-13 18:40 ` pinskia at gcc dot gnu dot org
2006-07-11 16:10 ` patchapp at dberlin dot org
2006-07-13  5:08 ` pault at gcc dot gnu dot org
2006-07-16 17:18 ` pault at gcc dot gnu dot org
2006-07-16 17:21 ` pault at gcc dot gnu dot org
2007-10-04 20:37 ` patchapp at dberlin dot 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).