[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #6 from pault at gcc dot gnu dot org 2007-10-02 07:17 --- Subject: Bug 31229 Author: pault Date: Tue Oct 2 07:17:01 2007 New Revision: 128948 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=128948 Log: 2007-10-02 Paul Thomas [EMAIL PROTECTED] PR fortran/31154 PR fortran/31229 PR fortran/4 * 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 [EMAIL PROTECTED] PR fortran/31154 PR fortran/31229 PR fortran/4 * 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=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #7 from pault at gcc dot gnu dot org 2007-10-02 07:22 --- 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=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #5 from pault at gcc dot gnu dot org 2007-09-22 18:40 --- Since I made a start on it, I had better finish 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-17 11:25:32 |2007-09-22 18:40:42 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #4 from burnus at gcc dot gnu dot org 2007-09-02 16:38 --- See also http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/11acfc0d9e65566e/ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #3 from kargl at gcc dot gnu dot org 2007-07-02 14:54 --- *** Bug 32578 has been marked as a duplicate of this bug. *** -- kargl at gcc dot gnu dot org changed: What|Removed |Added CC||jv244 at cam dot ac dot uk http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #2 from burnus at gcc dot gnu dot org 2007-05-26 23:24 --- The problem is the resolution happens too early. In decl.c the function is matched and immediately the kind parameter is resolved: gfc_match_kind_spec (gfc_typespec *ts) n = gfc_match_init_expr (e); // has not been declared or is a variable msg = gfc_extract_int (e, ts-kind); // Constant expression required For character lengths, it is easier as length is an expr and not as typespec's kind an enum. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
-- fxcoudert at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC host triplet|i686-pc-linux-gnu | Known to fail||4.1.3 4.2.0 4.3.0 Last reconfirmed|-00-00 00:00:00 |2007-03-17 11:25:32 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229
[Bug fortran/31229] kind parameter in function declaration fails to find use-associated parameters
--- Comment #1 from brooks at gcc dot gnu dot org 2007-03-16 22:40 --- This is probably related to Bug #31154 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31229