aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2006-08-30 05:18:36 +0000
committerPaul Thomas <pault@gcc.gnu.org>2006-08-30 05:18:36 +0000
commit8c086c9c6eceed0c8d1dbd8463272e1854e5b4e7 (patch)
treed537dbcb1097607a1a3c621891ffa482aa77638d /gcc/fortran/interface.c
parenta2ef097954b08063f1100d45c3d8499ac9fc46f8 (diff)
downloadgcc-8c086c9c6eceed0c8d1dbd8463272e1854e5b4e7.zip
gcc-8c086c9c6eceed0c8d1dbd8463272e1854e5b4e7.tar.gz
gcc-8c086c9c6eceed0c8d1dbd8463272e1854e5b4e7.tar.bz2
re PR fortran/28885 (ICE passing components of array of derived type)
2006-08-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/28885 REGRESSION FIX * trans-expr.c (gfc_conv_aliased_arg): Ensure that the temp declaration is retained for INTENT(OUT) arguments. PR fortran/28873 REGRESSION FIX PR fortran/20067 * resolve.c (resolve_generic_f): Make error message more comprehensible. (resolve_generic_s): Restructure search for specific procedures to be similar to resolve_generic_f and change to similar error message. Ensure that symbol reference is refreshed, in case the search produces a NULL. (resolve_specific_s): Restructure search, as above and as resolve_specific_f. Ensure that symbol reference is refreshed, in case the search produces a NULL. PR fortran/25077 PR fortran/25102 * interface.c (check_operator_interface): Throw error if the interface assignment tries to change intrinsic type assigments or has less than two arguments. Also, it is an error if an interface operator contains an alternate return. PR fortran/24866 * parse.c (gfc_fixup_sibling_symbols): Do not modify the symbol if it is a dummy in the contained namespace. 2006-08-30 Paul Thomas <pault@gcc.gnu.org> PR fortran/28885 * gfortran.dg/aliasing_dummy_2.f90: New test. PR fortran/20067 * gfortran.dg/generic_5.f90: Change error message. PR fortran/28873 * gfortran.dg/generic_6.f90: New test. PR fortran/25077 * gfortran.dg/redefined_intrinsic_assignment.f90: New test. PR fortran/25102 * gfortran.dg/invalid_interface_assignment.f90: New test. PR fortran/24866 * gfortran.dg/module_proc_external_dummy.f90: New test. From-SVN: r116578
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index f1d968d..47fc79b 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -503,7 +503,12 @@ check_operator_interface (gfc_interface * intr, gfc_intrinsic_op operator)
for (formal = intr->sym->formal; formal; formal = formal->next)
{
sym = formal->sym;
-
+ if (sym == NULL)
+ {
+ gfc_error ("Alternate return cannot appear in operator "
+ "interface at %L", &intr->where);
+ return;
+ }
if (args == 0)
{
t1 = sym->ts.type;
@@ -531,6 +536,24 @@ check_operator_interface (gfc_interface * intr, gfc_intrinsic_op operator)
&intr->where);
return;
}
+ if (args != 2)
+ {
+ gfc_error
+ ("Assignment operator interface at %L must have two arguments",
+ &intr->where);
+ return;
+ }
+ if (sym->formal->sym->ts.type != BT_DERIVED
+ && sym->formal->next->sym->ts.type != BT_DERIVED
+ && (sym->formal->sym->ts.type == sym->formal->next->sym->ts.type
+ || (gfc_numeric_ts (&sym->formal->sym->ts)
+ && gfc_numeric_ts (&sym->formal->next->sym->ts))))
+ {
+ gfc_error
+ ("Assignment operator interface at %L must not redefine "
+ "an INTRINSIC type assignment", &intr->where);
+ return;
+ }
}
else
{