Lines Matching defs:formal
23 singly linked list of formal argument structures attached to the
57 formal argument list structures that don't point to any symbol
63 formal argument list points to symbols within the same namespace as
702 that is for the formal arg, but oh well. */
802 /* Given two symbols that are formal arguments, compare their ranks
813 /* Given two symbols that are formal arguments, compare their types
814 and rank and their formal interfaces if they are both dummy
856 /* Given a formal argument list and a keyword name, search the list
881 gfc_formal_arglist *formal;
894 for (formal = gfc_sym_get_dummy_args (sym); formal; formal = formal->next)
896 gfc_symbol *fsym = formal->sym;
1116 /* Given a pair of formal argument lists, we see if the two lists can
1712 /* 'Compare' two formal interfaces associated with a pair of symbols.
1803 NULL, then the leading formal arguments are alternate returns.
2185 /* Given a symbol of a formal argument list and an expression, if the
2186 formal argument is allocatable, check that the actual argument is
2190 compare_allocatable (gfc_symbol *formal, gfc_expr *actual)
2192 if (formal->attr.allocatable
2193 || (formal->ts.type == BT_CLASS && CLASS_DATA (formal)->attr.allocatable))
2206 /* Given a symbol of a formal argument list and an expression, if the
2207 formal argument is a pointer, see if the actual argument is a
2211 compare_pointer (gfc_symbol *formal, gfc_expr *actual)
2215 if (formal->attr.pointer
2216 || (formal->ts.type == BT_CLASS && CLASS_DATA (formal)
2217 && CLASS_DATA (formal)->attr.class_pointer))
2222 if (!attr.pointer && attr.target && formal->attr.intent == INTENT_IN)
2341 /* Given a symbol of a formal argument list and an expression, see if
2346 compare_parameter (gfc_symbol *formal, gfc_expr *actual,
2355 /* If the formal arg has type BT_VOID, it's to one of the iso_c_binding
2358 if (formal->ts.type == BT_VOID)
2361 if (formal->ts.type == BT_DERIVED
2362 && formal->ts.u.derived && formal->ts.u.derived->ts.is_iso_c
2366 if (formal->ts.u.derived->intmod_sym_id
2371 && symbol_rank (formal) != actual->rank
2372 && symbol_rank (formal) != -1)
2375 argument_rank_mismatch (formal->name, &actual->where,
2376 formal), actual->rank,
2383 if (formal->ts.type == BT_CLASS && actual->ts.type == BT_DERIVED)
2392 if (formal->attr.flavor != FL_PROCEDURE && !act_sym->ts.interface)
2399 && !gfc_compare_interfaces (formal, act_sym->ts.interface,
2405 " %s", formal->name, &actual->where, err);
2409 if (!gfc_compare_interfaces (formal, act_sym, act_sym->name, 0, 1, err,
2414 " %s", formal->name, &actual->where, err);
2418 if (formal->attr.function && !act_sym->attr.function)
2426 else if (formal->attr.subroutine && !act_sym->attr.subroutine)
2436 if (!gfc_compare_interfaces (formal, ppc->ts.interface, ppc->name, 0, 1,
2441 " %s", formal->name, &actual->where, err);
2447 if (formal->attr.pointer && formal->attr.contiguous
2452 "must be simply contiguous", formal->name, &actual->where);
2462 && formal->ts.type != BT_ASSUMED
2463 && !(formal->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
2464 && !gfc_compare_types (&formal->ts, &actual->ts)
2465 && !(formal->ts.type == BT_DERIVED && actual->ts.type == BT_CLASS
2466 && gfc_compare_derived_types (formal->ts.u.derived,
2471 if (formal->attr.artificial)
2473 if (!flag_allow_argument_mismatch || !formal->error)
2477 &formal->declared_at,
2479 gfc_dummy_typename (&formal->ts));
2481 formal->error = 1;
2485 "to %s", formal->name, where, gfc_typename (actual),
2486 gfc_dummy_typename (&formal->ts));
2491 if (actual->ts.type == BT_ASSUMED && formal->ts.type != BT_ASSUMED)
2496 formal->name);
2502 && symbol_rank (formal) == -1
2511 &actual->where, formal->name);
2516 if (formal->ts.type == BT_CLASS && formal->attr.class_ok
2518 && ((CLASS_DATA (formal)->attr.class_pointer
2519 && formal->attr.intent != INTENT_IN)
2520 || CLASS_DATA (formal)->attr.allocatable))
2526 formal->name, &actual->where);
2530 if ((!UNLIMITED_POLY (formal) || !UNLIMITED_POLY(actual))
2532 CLASS_DATA (formal)->ts.u.derived))
2536 "declared type", formal->name, &actual->where);
2545 if (UNLIMITED_POLY (formal) && !UNLIMITED_POLY (actual)
2546 && (CLASS_DATA (formal)->attr.allocatable
2547 ||CLASS_DATA (formal)->attr.class_pointer))
2551 "polymorphic since the formal argument is a "
2553 "entity [F2008: 12.5.2.5]", formal->name,
2558 if (formal->ts.type == BT_CLASS && formal->attr.class_ok)
2559 codimension = CLASS_DATA (formal)->attr.codimension;
2561 codimension = formal->attr.codimension;
2567 formal->name, &actual->where);
2571 if (codimension && formal->attr.allocatable)
2580 if ((last && last->u.c.component->as->corank != formal->as->corank)
2582 && actual->symtree->n.sym->as->corank != formal->as->corank))
2586 formal->name, &actual->where, formal->as->corank,
2597 if (formal->attr.dimension
2598 && (formal->attr.contiguous || formal->as->type != AS_ASSUMED_SHAPE)
2605 formal->name, &actual->where);
2610 if (formal->attr.intent != INTENT_INOUT
2611 && (((formal->ts.type == BT_DERIVED || formal->ts.type == BT_CLASS)
2612 && formal->ts.u.derived->from_intmod == INTMOD_ISO_FORTRAN_ENV
2613 && formal->ts.u.derived->intmod_sym_id == ISOFORTRAN_LOCK_TYPE)
2614 || formal->attr.lock_comp))
2620 formal->name, &actual->where);
2625 if (formal->attr.intent != INTENT_INOUT
2626 && (((formal->ts.type == BT_DERIVED || formal->ts.type == BT_CLASS)
2627 && formal->ts.u.derived->from_intmod == INTMOD_ISO_FORTRAN_ENV
2628 && formal->ts.u.derived->intmod_sym_id == ISOFORTRAN_EVENT_TYPE)
2629 || formal->attr.event_comp))
2635 formal->name, &actual->where);
2644 && (formal->attr.asynchronous || formal->attr.volatile_)
2645 && actual->rank && formal->as
2647 && ((formal->as->type != AS_ASSUMED_SHAPE
2648 && formal->as->type != AS_ASSUMED_RANK && !formal->attr.pointer)
2649 || formal->attr.contiguous))
2655 "ASYNCHRONOUS or VOLATILE", formal->name, &actual->where);
2659 if (formal->attr.allocatable && !codimension
2662 if (formal->attr.intent == INTENT_OUT)
2667 formal->name);
2670 else if (warn_surprising && where && formal->attr.intent != INTENT_IN)
2674 " is modified", &actual->where, formal->name);
2677 /* If the rank is the same or the formal argument has assumed-rank. */
2678 if (symbol_rank (formal) == actual->rank || symbol_rank (formal) == -1)
2681 rank_check = where != NULL && !is_elemental && formal->as
2682 && (formal->as->type == AS_ASSUMED_SHAPE
2683 || formal->as->type == AS_DEFERRED)
2687 if (formal->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
2692 || (formal->attr.pointer && actual->expr_type != EXPR_NULL)
2693 || (actual->rank != 0 && !(is_elemental || formal->attr.dimension))
2695 && ((formal->ts.type == BT_CLASS
2696 && CLASS_DATA (formal)->as->type == AS_ASSUMED_SHAPE)
2697 || (formal->ts.type != BT_CLASS
2698 && formal->as->type == AS_ASSUMED_SHAPE))
2700 || (actual->rank == 0 && formal->attr.dimension
2706 && (!formal->attr.artificial || (!formal->maybe_array
2710 if (formal->attr.artificial)
2711 where_formal = &formal->declared_at;
2715 argument_rank_mismatch (formal->name, &actual->where,
2716 symbol_rank (formal), actual->rank,
2721 else if (actual->rank != 0 && (is_elemental || formal->attr.dimension))
2749 "at %L", formal->name, &actual->where);
2758 if (formal->attr.artificial)
2762 &actual->where, &formal->declared_at);
2766 formal->name, &actual->where);
2774 if (formal->ts.kind != 1 && (gfc_option.allow_std & GFC_STD_GNU) == 0)
2779 "%qs at %L", formal->name, &actual->where);
2787 formal->name, &actual->where);
2797 && (!formal->attr.artificial || (!formal->maybe_array
2801 if (formal->attr.artificial)
2802 where_formal = &formal->declared_at;
2806 argument_rank_mismatch (formal->name, &actual->where,
2807 symbol_rank (formal), actual->rank,
2817 /* Returns the storage size of a symbol (formal argument) or
3109 get_nonintrinsic_dummy_arg (gfc_formal_arglist *formal)
3114 dummy_arg->u.non_intrinsic = formal;
3120 /* Given formal and actual argument lists, see if they are compatible.
3122 correspond with the formal list, and elements for missing optional
3128 gfc_compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
3145 if (actual == NULL && formal == NULL)
3149 for (f = formal; f; f = f->next)
3158 f = formal;
3174 for (f = formal; f; f = f->next, i++)
3186 const char *guessed = lookup_arg_fuzzy (a->name, formal);
3211 gfc_error ("More actual than formal arguments in procedure "
3249 polymorphic formal arguments. */
3392 argument is provided for a procedure pointer formal argument. */
3408 provided for a procedure formal argument. */
3730 for (f = formal; f; f = f->next, i++)
3756 /* We should have handled the cases where the formal arglist is null
3763 for (f = formal, i = 0; f; f = f->next, i++)
3887 /* Given formal and actual argument lists that correspond to one
3957 /* Given formal and actual argument lists that correspond to one
4263 if (!gfc_compare_actual_formal (ap, comp->ts.interface->formal, 0,
4267 check_intents (comp->ts.interface->formal, *ap);
4269 check_some_aliasing (comp->ts.interface->formal, *ap);
4273 /* Try if an actual argument list matches the formal list of a symbol,
4302 a formal argument list that matches the actual. If found, returns
4489 /* Check if this arglist matches the formal. */
4957 /* Gets rid of a formal argument list. We do not free symbols.
5079 /* Compare the formal argument lists of both procedures. This is also abused
5124 gfc_error ("%qs at %L must have the same number of formal arguments as"
5162 /* The following three functions check that the formal arguments
5211 gfc_formal_arglist *formal;
5244 if (intr->sym && intr->sym->formal && intr->sym->formal->sym
5245 && ((intr->sym->formal->sym->ts.type == BT_CLASS
5246 && CLASS_DATA (intr->sym->formal->sym)->ts.u.derived
5248 || (intr->sym->formal->sym->ts.type == BT_DERIVED
5249 && intr->sym->formal->sym->ts.u.derived == derived)))
5254 else if (intr->sym && intr->sym->formal && !intr->sym->formal->sym)
5275 for (formal = dtio_sub->formal; formal; formal = formal->next)
5292 /* Now go through the formal arglist. */
5294 for (formal = dtio_sub->formal; formal; formal = formal->next, arg_num++)
5298 fsym = formal->sym;
5520 if (intr->sym->formal)
5522 gfc_symbol *fsym = intr->sym->formal->sym;
5538 && dtio_sub->formal->sym->ts.type == BT_CLASS
5539 && derived != CLASS_DATA (dtio_sub->formal->sym)->ts.u.derived)
5561 f = &sym->formal;