aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2015-07-17 17:23:45 +0000
committerPaul Thomas <pault@gcc.gnu.org>2015-07-17 17:23:45 +0000
commit3d5dc929f4077f3d5e8d6fddaa4f196d21a31ebc (patch)
tree8c5237225381a2a0cd6f8e9c085f9249fa064ca6 /gcc/fortran/decl.c
parent896c28a7fad4b23f722bd538c972160d0c9bc88d (diff)
downloadgcc-3d5dc929f4077f3d5e8d6fddaa4f196d21a31ebc.zip
gcc-3d5dc929f4077f3d5e8d6fddaa4f196d21a31ebc.tar.gz
gcc-3d5dc929f4077f3d5e8d6fddaa4f196d21a31ebc.tar.bz2
re PR fortran/52846 ([F2008] Support submodules)
2015-07-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/52846 * decl.c (gfc_match_end): Pick out declared submodule name from the composite identifier. * gfortran.h : Add 'submodule_name' to gfc_use_list structure. * module.c (gfc_match_submodule): Define submodule_name and add static 'submodule_name'. (gfc_match_submodule): Build up submodule filenames, using '@' as a delimiter. Store the output filename in 'submodule_name'. Similarly, the submodule identifier is built using '.' as an identifier. (gfc_dump_module): If current state is COMP_SUBMODULE, write to file 'submodule_name', using SUBMODULE_EXTENSION. (gfc_use_module): Similarly, use the 'submodule_name' field in the gfc_use_list structure and SUBMODULE_EXTENSION to read the implicitly used submodule files. 2015-07-17 Paul Thomas <pault@gcc.gnu.org> PR fortran/52846 * lib/fortran-modules.exp (proc cleanup-submodules): New procedure. * gfortran.dg/submodule_1.f08: Change extension and clean up the submodule files. * gfortran.dg/submodule_2.f08: ditto * gfortran.dg/submodule_6.f08: ditto * gfortran.dg/submodule_7.f08: ditto * gfortran.dg/submodule_8.f08: New test * gfortran.dg/submodule_9.f08: New test From-SVN: r225945
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 4946061..ebc88ea 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -6450,6 +6450,11 @@ gfc_match_end (gfc_statement *st)
if (block_name == NULL)
goto syntax;
+ /* We have to pick out the declared submodule name from the composite
+ required by F2008:11.2.3 para 2, which ends in the declared name. */
+ if (state == COMP_SUBMODULE)
+ block_name = strchr (block_name, '.') + 1;
+
if (strcmp (name, block_name) != 0 && strcmp (block_name, "ppr@") != 0)
{
gfc_error ("Expected label %qs for %s statement at %C", block_name,