This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR30878 - Rejects function f1; namelist /nml/ f1


:REVIEWMAIL:

2007-05-09 Paul Thomas <pault@gcc.gnu.org>

       PR fortran/30878
       * resolve.c (resolve_fl_namelist): It is not an error if the
       namelist element is the result variable of the enclosing
       function.  Search for the symbol in current and all parent
       namespaces for a potential conflict.
       * symbol.c (check_conflict): Remove the conflict between
       'in_namelist' and 'FL_PROCEDURE' because the symbol info
       is not available to exclude function result variables.
       * trans-io.c (nml_get_addr_expr): Use the fake result decl
       if the symbol is an implicit result variable.

There's one thing I don't understand: I think the following part of the diff file you sent is not part of this patch:


*************** resolve_fl_parameter (gfc_symbol *sym)
*** 6131,6139 ****
  static void
  resolve_symbol (gfc_symbol *sym)
  {
!   /* Zero if we are checking a formal namespace.  */
!   static int formal_ns_flag = 1;
!   int formal_ns_save, check_constant, mp_flag;
    gfc_symtree *symtree;
    gfc_symtree *this_symtree;
    gfc_namespace *ns;
--- 6136,6142 ----
  static void
  resolve_symbol (gfc_symbol *sym)
  {
!   int check_constant, mp_flag;
    gfc_symtree *symtree;
    gfc_symtree *this_symtree;
    gfc_namespace *ns;
*************** resolve_symbol (gfc_symbol *sym)
*** 6340,6357 ****

formal_arg_flag = 0;

! /* Resolve formal namespaces. The symbols in formal namespaces that
! themselves are from procedures in formal namespaces will not stand
! resolution, except when they are use associated.
! TODO: Fix the symbols in formal namespaces so that resolution can
! be done unconditionally. */
! if (formal_ns_flag && sym != NULL && sym->formal_ns != NULL)
! {
! formal_ns_save = formal_ns_flag;
! formal_ns_flag = sym->attr.use_assoc ? 1 : 0;
! gfc_resolve (sym->formal_ns);
! formal_ns_flag = formal_ns_save;
! }


    /* Check threadprivate restrictions.  */
    if (sym->attr.threadprivate && !sym->attr.save
--- 6343,6351 ----

formal_arg_flag = 0;

!   /* Resolve formal namespaces.  */
!   if (sym->formal_ns && sym->formal_ns != gfc_current_ns)
!     gfc_resolve (sym->formal_ns);

    /* Check threadprivate restrictions.  */
    if (sym->attr.threadprivate && !sym->attr.save

Unless I'm mistaken, this is part of the PR31630 patch, which I already approved. Apart from that note, your patch is OK.


Thanks for this patch (and all others coming in in a constant flow :)
FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]