public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31154]  New: IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
@ 2007-03-12 19:16 burnus at gcc dot gnu dot org
  2007-03-16 22:40 ` [Bug fortran/31154] " brooks at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-12 19:16 UTC (permalink / raw)
  To: gcc-bugs

+++ This bug was initially created as a clone of Bug #30922 +++

gfortran currently does not like the following:
------------------------------------
module x
  implicit none
  integer, parameter :: d=8
  interface
    real(d) function y()
      import
    end function
  end interface
end module x
------------------------------------

    real(d) function y()
        1
Error: Parameter 'd' at (1) has not been declared or is a variable, which does
not reduce to a constant expression

(A real-world example for the latter is:
http://users.erols.com/dnagle/pub/pthread.f03,
which also needs ISO_C_BINDING support.)


-- 
           Summary: IMPORT fails for  "<imported symbol> FUNCTION (...)"
                    kind of procedures
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
 BugsThisDependsOn: 30922


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
@ 2007-03-16 22:40 ` brooks at gcc dot gnu dot org
  2007-03-18 18:03 ` fxcoudert at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-16 22:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from brooks at gcc dot gnu dot org  2007-03-16 22:39 -------
This is probably related to Bug #31229.


-- 

brooks at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |brooks at gcc dot gnu dot
                   |                            |org


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
  2007-03-16 22:40 ` [Bug fortran/31154] " brooks at gcc dot gnu dot org
@ 2007-03-18 18:03 ` fxcoudert at gcc dot gnu dot org
  2007-07-02 22:28 ` burnus at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-03-18 18:03 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-18 18:03:00
               date|                            |


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
  2007-03-16 22:40 ` [Bug fortran/31154] " brooks at gcc dot gnu dot org
  2007-03-18 18:03 ` fxcoudert at gcc dot gnu dot org
@ 2007-07-02 22:28 ` burnus at gcc dot gnu dot org
  2007-09-07 15:02 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-02 22:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2007-07-02 22:28 -------
Related is the checking of type(*). Here, in decl.c everything is allowed and a
later check is missing. Result: accepts invalid:

--------------
module x
 implicit none
 type t
   integer :: i
 end type t
 interface
   type(t) function bar()
   end function
 end interface
end


-- 


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-02 22:28 ` burnus at gcc dot gnu dot org
@ 2007-09-07 15:02 ` burnus at gcc dot gnu dot org
  2007-09-08  5:02 ` patchapp at dberlin dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-09-07 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2007-09-07 15:02 -------
(In reply to comment #2)
This accept-invalid bug is now tracked as PR33334.


-- 


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-09-07 15:02 ` burnus at gcc dot gnu dot org
@ 2007-09-08  5:02 ` patchapp at dberlin dot org
  2007-09-22 18:43 ` pault at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: patchapp at dberlin dot org @ 2007-09-08  5:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from patchapp at dberlin dot org  2007-09-08 05:02 -------
Subject: Bug number PR31154

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-09/msg00618.html


-- 


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-09-08  5:02 ` patchapp at dberlin dot org
@ 2007-09-22 18:43 ` pault at gcc dot gnu dot org
  2007-09-27  0:11 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-09-22 18:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pault at gcc dot gnu dot org  2007-09-22 18:43 -------
I'd better get on with it!

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-03-18 18:03:00         |2007-09-22 18:43:12
               date|                            |


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-09-22 18:43 ` pault at gcc dot gnu dot org
@ 2007-09-27  0:11 ` patchapp at dberlin dot org
  2007-10-02  7:17 ` pault at gcc dot gnu dot org
  2007-10-02  7:22 ` pault at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: patchapp at dberlin dot org @ 2007-09-27  0:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from patchapp at dberlin dot org  2007-09-27 00:11 -------
Subject: Bug number PR31154

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-09/msg01901.html


-- 


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-09-27  0:11 ` patchapp at dberlin dot org
@ 2007-10-02  7:17 ` pault at gcc dot gnu dot org
  2007-10-02  7:22 ` pault at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-10-02  7:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pault at gcc dot gnu dot org  2007-10-02 07:17 -------
Subject: Bug 31154

Author: pault
Date: Tue Oct  2 07:17:01 2007
New Revision: 128948

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128948
Log:
2007-10-02  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31154
        PR fortran/31229
        PR fortran/33334
        * decl.c : Declare gfc_function_kind_locs and
        gfc_function_type_locus.
        (gfc_match_kind_spec): Add second argument kind_expr_only.
        Store locus before trying to match the expression. If the
        current state corresponds to a function declaration and there
        is no match to the expression, read to the parenthesis, return
        kind = -1, dump the expression and return.
        (gfc_match_type_spec): Renamed from match_type_spec and all
        references changed.  If an interface or an external function,
        store the locus, set kind = -1 and return.  Otherwise, if kind
        is already = -1, use gfc_find_symbol to try to find a use
        associated or imported type.
        match.h : Prototype for gfc_match_type_spec.
        * parse.c (match_deferred_characteristics): New function.
        (parse_spec): If in a function, statement is USE or IMPORT
        or DERIVED_DECL and the function kind=-1, call
        match_deferred_characteristics.  If kind=-1 at the end of the
        specification expressions, this is an error.
        * parse.h : Declare external gfc_function_kind_locs and
        gfc_function_type_locus.

2007-10-02  Paul Thomas  <pault@gcc.gnu.org>

        PR fortran/31154
        PR fortran/31229
        PR fortran/33334
        * gfortran.dg/function_kinds_1.f90: New test.
        * gfortran.dg/function_kinds_2.f90: New test.
        * gfortran.dg/derived_function_interface_1.f90: Correct illegal
        use association into interfaces.


Added:
    trunk/gcc/testsuite/gfortran.dg/function_kinds_1.f90
    trunk/gcc/testsuite/gfortran.dg/function_kinds_2.f90
    trunk/gcc/testsuite/gfortran.dg/intent_out_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/match.h
    trunk/gcc/fortran/parse.c
    trunk/gcc/fortran/parse.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/derived_function_interface_1.f90


-- 


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


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

* [Bug fortran/31154] IMPORT fails for  "<imported symbol> FUNCTION (...)" kind of procedures
  2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-10-02  7:17 ` pault at gcc dot gnu dot org
@ 2007-10-02  7:22 ` pault at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: pault at gcc dot gnu dot org @ 2007-10-02  7:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from pault at gcc dot gnu dot org  2007-10-02 07:21 -------
Fixed on trunk

Paul


-- 

pault at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-10-02  7:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-12 19:16 [Bug fortran/31154] New: IMPORT fails for "<imported symbol> FUNCTION (...)" kind of procedures burnus at gcc dot gnu dot org
2007-03-16 22:40 ` [Bug fortran/31154] " brooks at gcc dot gnu dot org
2007-03-18 18:03 ` fxcoudert at gcc dot gnu dot org
2007-07-02 22:28 ` burnus at gcc dot gnu dot org
2007-09-07 15:02 ` burnus at gcc dot gnu dot org
2007-09-08  5:02 ` patchapp at dberlin dot org
2007-09-22 18:43 ` pault at gcc dot gnu dot org
2007-09-27  0:11 ` patchapp at dberlin dot org
2007-10-02  7:17 ` pault at gcc dot gnu dot org
2007-10-02  7:22 ` pault at gcc dot gnu 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).