diff options
author | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-30 13:33:27 +0000 |
---|---|---|
committer | pault <pault@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-30 13:33:27 +0000 |
commit | a23f57e2532c55d99f1a65745a5bde4eebec97c1 (patch) | |
tree | 2b2cbae4d77a9f7243f7234671539d7495c7eb42 /gcc/fortran/decl.c | |
parent | a7bb97dc8ee884a05bd7d7466de9fc518baae54d (diff) |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231072 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index c4ce18b9ad9d..10a08e0591be 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; |