diff options
author | Tobias Burnus <burnus@net-b.de> | 2014-10-06 07:57:57 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2014-10-06 07:57:57 +0200 |
commit | 8b7a967ed4c20e00fc966e3d30a09fed74216dc7 (patch) | |
tree | 3fd948e1c22f57c5745797415d9f60822a38992e /gcc/fortran/symbol.c | |
parent | 116886341f638b539387bc900bc513ebe5ad6696 (diff) | |
download | gcc-8b7a967ed4c20e00fc966e3d30a09fed74216dc7.zip gcc-8b7a967ed4c20e00fc966e3d30a09fed74216dc7.tar.gz gcc-8b7a967ed4c20e00fc966e3d30a09fed74216dc7.tar.bz2 |
libgfortran.h (GFC_STD_F2015): Add.
2014-10-06 Tobias Burnus <burnus@net-b.de>
gcc/fortran/
* libgfortran.h (GFC_STD_F2015): Add.
* decl.c (gfc_match_implicit_none): Handle spec list.
(gfc_match_implicit): Move double intrinsic warning here.
* gfortran.h (gfc_namespace): Add has_implicit_none_export:1.
(gfc_set_implicit_none): Update interface.
* interface.c (gfc_procedure_use): Add implicit-none external
error check.
* parse.c (accept_statement): Remove call.
(verify_st_order): Permit that external-implict-none follows
implicit statement.
* symbol.c (gfc_set_implicit_none): Handle external/type
implicit none.
gcc/testsuite/
* gfortran.dg/implicit_14.f90: New.
* gfortran.dg/implicit_15.f90: New.
* gfortran.dg/implicit_4.f90: Update dg-error.
From-SVN: r215914
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 8e1d8b3..0ccbd1f 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -114,22 +114,34 @@ static int new_flag[GFC_LETTERS]; /* Handle a correctly parsed IMPLICIT NONE. */ void -gfc_set_implicit_none (void) +gfc_set_implicit_none (bool type, bool external) { int i; - if (gfc_current_ns->seen_implicit_none) + if (gfc_current_ns->seen_implicit_none + || gfc_current_ns->has_implicit_none_export) { - gfc_error ("Duplicate IMPLICIT NONE statement at %C"); + gfc_error_now ("Duplicate IMPLICIT NONE statement at %C"); return; } - gfc_current_ns->seen_implicit_none = 1; + if (external) + gfc_current_ns->has_implicit_none_export = 1; - for (i = 0; i < GFC_LETTERS; i++) + if (type) { - gfc_clear_ts (&gfc_current_ns->default_type[i]); - gfc_current_ns->set_flag[i] = 1; + gfc_current_ns->seen_implicit_none = 1; + for (i = 0; i < GFC_LETTERS; i++) + { + if (gfc_current_ns->set_flag[i]) + { + gfc_error_now ("IMPLICIT NONE (type) statement at %C following an " + "IMPLICIT statement"); + return; + } + gfc_clear_ts (&gfc_current_ns->default_type[i]); + gfc_current_ns->set_flag[i] = 1; + } } } @@ -2383,6 +2395,9 @@ gfc_get_namespace (gfc_namespace *parent, int parent_types) } } + if (parent_types && ns->parent != NULL) + ns->has_implicit_none_export = ns->parent->has_implicit_none_export; + ns->refs = 1; return ns; |