diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2011-06-02 17:39:11 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2011-06-02 17:39:11 +0000 |
commit | 162b5a21add6f291f4c57cc14e2c2e915cb2029c (patch) | |
tree | 242a5caaf3adfe3919008fa60117ab80217b7e2f /gcc/fortran/decl.c | |
parent | 6e588138db4f545f3d14b96fe946150b594294ae (diff) | |
download | gcc-162b5a21add6f291f4c57cc14e2c2e915cb2029c.zip gcc-162b5a21add6f291f4c57cc14e2c2e915cb2029c.tar.gz gcc-162b5a21add6f291f4c57cc14e2c2e915cb2029c.tar.bz2 |
re PR fortran/49265 (Double colon in procedure-stmt (generic interface))
2011-06-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/49265
* decl.c (gfc_match_modproc): Allow for a double colon in a module
procedure statement.
* parse.c ( decode_statement): Deal with whitespace around :: in
gfc_match_modproc.
2011-06-02 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/49265
* gfortran.dg/module_procedure_double_colon_1.f90: New test.
* gfortran.dg/module_procedure_double_colon_2.f90: New test.
From-SVN: r174569
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index e97168f..f914156 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -7016,6 +7016,7 @@ gfc_match_modproc (void) char name[GFC_MAX_SYMBOL_LEN + 1]; gfc_symbol *sym; match m; + locus old_locus; gfc_namespace *module_ns; gfc_interface *old_interface_head, *interface; @@ -7044,10 +7045,23 @@ gfc_match_modproc (void) end up with a syntax error and need to recover. */ old_interface_head = gfc_current_interface_head (); + /* Check if the F2008 optional double colon appears. */ + gfc_gobble_whitespace (); + old_locus = gfc_current_locus; + if (gfc_match ("::") == MATCH_YES) + { + if (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: double colon in " + "MODULE PROCEDURE statement at %L", &old_locus) + == FAILURE) + return MATCH_ERROR; + } + else + gfc_current_locus = old_locus; + for (;;) { - locus old_locus = gfc_current_locus; bool last = false; + old_locus = gfc_current_locus; m = gfc_match_name (name); if (m == MATCH_NO) @@ -7059,6 +7073,7 @@ gfc_match_modproc (void) current namespace. */ if (gfc_match_eos () == MATCH_YES) last = true; + if (!last && gfc_match_char (',') != MATCH_YES) goto syntax; |