diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2015-11-30 13:33:27 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2015-11-30 13:33:27 +0000 |
commit | 0ef5fbc1f4b4e34e4b084f5b59b0885bfa3300fb (patch) | |
tree | 2b2cbae4d77a9f7243f7234671539d7495c7eb42 /gcc/fortran | |
parent | 02718b323ba585f41a34e4202c9ca5ba1b3aa321 (diff) | |
download | gcc-0ef5fbc1f4b4e34e4b084f5b59b0885bfa3300fb.zip gcc-0ef5fbc1f4b4e34e4b084f5b59b0885bfa3300fb.tar.gz gcc-0ef5fbc1f4b4e34e4b084f5b59b0885bfa3300fb.tar.bz2 |
re PR fortran/68534 (No error on mismatch in number of arguments between submodule and module interface)
2015-11-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68534
* decl.c (gfc_match_formal_arglist): Cope with zero formal args
either in interface declaration or in procedure declaration in
submodule.
2015-11-30 Paul Thomas <pault@gcc.gnu.org>
PR fortran/68534
* gfortran.dg/submodule_13.f08: New test.
From-SVN: r231072
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 19 |
2 files changed, 26 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f1ad5e1..c7c5064 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2015-11-30 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/68534 + * decl.c (gfc_match_formal_arglist): Cope with zero formal args + either in interface declaration or in procedure declaration in + submodule. + 2015-11-25 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/68227 @@ -68,7 +75,7 @@ * resolve.c (gfc_resolve_blocks): Handle EXEC_OACC_DECLARE. * st.c (gfc_free_statement): Handle EXEC_OACC_DECLARE. * symbol.c (check_conflict): Add conflict checks. - (gfc_add_oacc_declare_create, gfc_add_oacc_declare_copyin, + (gfc_add_oacc_declare_create, gfc_add_oacc_declare_copyin, gfc_add_oacc_declare_deviceptr, gfc_add_oacc_declare_device_resident): New functions. (gfc_copy_attr): Handle new symbols. @@ -84,7 +91,7 @@ 2015-11-21 Steven G. Kargl <kargl@gcc.gnu.org> * simplify.c (gfc_simplify_cshift): Work around bootstrap issues - due to inappropriate warning options. + due to inappropriate warning options. 2015-11-21 Steven G. Kargl <kargl@gcc.gnu.org> @@ -93,7 +100,7 @@ (gfc_simplify_spread): Remove a FIXME and add error condition. * intrinsic.h: Prototype for gfc_simplify_cshift * intrinsic.c (add_functions): Use gfc_simplify_cshift. - + 2015-11-20 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/68237 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index c4ce18b..10a08e0 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -4817,14 +4817,23 @@ ok: goto cleanup; } - if (formal) + if (progname->attr.module_procedure && progname->attr.host_assoc) { + bool arg_count_mismatch = false; + + if (!formal && head) + arg_count_mismatch = true; + + /* Abbreviated module procedure declaration is not meant to have any + formal arguments! */ + if (!sym->abr_modproc_decl && formal && !head) + arg_count_mismatch = true; + for (p = formal, q = head; p && q; p = p->next, q = q->next) { if ((p->next != NULL && q->next == NULL) || (p->next == NULL && q->next != NULL)) - gfc_error_now ("Mismatch in number of MODULE PROCEDURE " - "formal arguments at %C"); + arg_count_mismatch = true; else if ((p->sym == NULL && q->sym == NULL) || strcmp (p->sym->name, q->sym->name) == 0) continue; @@ -4833,6 +4842,10 @@ ok: "argument names (%s/%s) at %C", p->sym->name, q->sym->name); } + + if (arg_count_mismatch) + gfc_error_now ("Mismatch in number of MODULE PROCEDURE " + "formal arguments at %C"); } return MATCH_YES; |