diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-06-16 11:06:13 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-06-16 11:06:13 +0200 |
commit | 8ad15a0a8d0666e21f4217d8ba004b33bcaf383d (patch) | |
tree | 68f16e73b7e9ee77f41c0bfa780dcfa5036ca069 /gcc/fortran/expr.c | |
parent | 7c5222ff1a2283b0f8c889da777c7dae5d4224ba (diff) | |
download | gcc-8ad15a0a8d0666e21f4217d8ba004b33bcaf383d.zip gcc-8ad15a0a8d0666e21f4217d8ba004b33bcaf383d.tar.gz gcc-8ad15a0a8d0666e21f4217d8ba004b33bcaf383d.tar.bz2 |
re PR fortran/36947 (Attributes not fully checked comparing actual vs dummy procedure)
2009-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/36947
PR fortran/40039
* expr.c (gfc_check_pointer_assign): Call 'gfc_compare_interfaces' with
error message.
* gfortran.h (gfc_compare_interfaces): Additional argument.
* interface.c (operator_correspondence): Removed.
(gfc_compare_interfaces): Additional argument to return error message.
Directly use the code from 'operator_correspondence' instead of calling
the function. Check for OPTIONAL. Some rearrangements.
(check_interface1): Call 'gfc_compare_interfaces' without error message.
(compare_parameter): Call 'gfc_compare_interfaces' with error message.
* resolve.c (check_generic_tbp_ambiguity): Call 'gfc_compare_interfaces'
without error message.
2009-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/36947
PR fortran/40039
* gfortran.dg/dummy_procedure_1.f90: Extended test case.
* gfortran.dg/interface_20.f90: Modified error messages.
* gfortran.dg/interface_21.f90: Ditto.
* gfortran.dg/interface_26.f90: Ditto.
* gfortran.dg/interface_27.f90: Ditto.
* gfortran.dg/interface_28.f90: Extended test case.
* gfortran.dg/interface_29.f90: New.
* gfortran.dg/proc_decl_7.f90: Modified error messages.
* gfortran.dg/proc_decl_8.f90: Ditto.
* gfortran.dg/proc_ptr_11.f90: Ditto.
* gfortran.dg/proc_ptr_15.f90: Ditto.
From-SVN: r148519
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 9342719..13c6b63 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3142,6 +3142,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) /* Checks on rvalue for procedure pointer assignments. */ if (proc_pointer) { + char err[200]; attr = gfc_expr_attr (rvalue); if (!((rvalue->expr_type == EXPR_NULL) || (rvalue->expr_type == EXPR_FUNCTION && attr.proc_pointer) @@ -3181,10 +3182,11 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) return SUCCESS; if (rvalue->expr_type == EXPR_VARIABLE && !gfc_compare_interfaces (lvalue->symtree->n.sym, - rvalue->symtree->n.sym, 0, 1)) + rvalue->symtree->n.sym, 0, 1, err, + sizeof(err))) { - gfc_error ("Interfaces don't match " - "in procedure pointer assignment at %L", &rvalue->where); + gfc_error ("Interface mismatch in procedure pointer assignment " + "at %L: %s", &rvalue->where, err); return FAILURE; } return SUCCESS; |