aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index aee04ecc..c327a82 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -23,6 +23,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor,Boston, MA
#include "config.h"
#include "system.h"
+#include "flags.h"
#include "gfortran.h"
#include "arith.h" /* For gfc_compare_expr(). */
#include "dependency.h"
@@ -1007,18 +1008,19 @@ resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
else if (isym)
formal_optional = true;
- if (arg->expr != NULL
+ if (pedantic && arg->expr != NULL
&& arg->expr->expr_type == EXPR_VARIABLE
&& arg->expr->symtree->n.sym->attr.optional
&& formal_optional
&& arg->expr->rank
- && (set_by_optional || arg->expr->rank != rank))
+ && (set_by_optional || arg->expr->rank != rank)
+ && !(isym && isym->generic_id == GFC_ISYM_CONVERSION))
{
- gfc_error ("'%s' at %L is an array and OPTIONAL; it cannot "
- "therefore be an actual argument of an ELEMENTAL "
- "procedure unless there is a non-optional argument "
- "with the same rank (12.4.1.5)",
- arg->expr->symtree->n.sym->name, &arg->expr->where);
+ gfc_warning ("'%s' at %L is an array and OPTIONAL; IF IT IS "
+ "MISSING, it cannot be the actual argument of an "
+ "ELEMENTAL procedure unless there is a non-optional"
+ "argument with the same rank (12.4.1.5)",
+ arg->expr->symtree->n.sym->name, &arg->expr->where);
return FAILURE;
}
}
@@ -6100,12 +6102,12 @@ gfc_elemental (gfc_symbol * sym)
/* Warn about unused labels. */
static void
-warn_unused_label (gfc_st_label * label)
+warn_unused_fortran_label (gfc_st_label * label)
{
if (label == NULL)
return;
- warn_unused_label (label->left);
+ warn_unused_fortran_label (label->left);
if (label->defined == ST_LABEL_UNKNOWN)
return;
@@ -6126,7 +6128,7 @@ warn_unused_label (gfc_st_label * label)
break;
}
- warn_unused_label (label->right);
+ warn_unused_fortran_label (label->right);
}
@@ -6649,7 +6651,7 @@ resolve_types (gfc_namespace * ns)
/* Warn about unused labels. */
if (gfc_option.warn_unused_labels)
- warn_unused_label (ns->st_labels);
+ warn_unused_fortran_label (ns->st_labels);
gfc_resolve_uops (ns->uop_root);