diff options
author | Tobias Burnus <burnus@net-b.de> | 2014-12-31 18:16:06 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2014-12-31 18:16:06 +0100 |
commit | 2e9cc48c28941114a7b05e42d1ab6abd6919ce62 (patch) | |
tree | c17275a2aa720df2f31c19545be1af6909c60919 /gcc/fortran | |
parent | 1a33dc9ec24fed0406de07f54e0442915e3cfedb (diff) | |
download | gcc-2e9cc48c28941114a7b05e42d1ab6abd6919ce62.zip gcc-2e9cc48c28941114a7b05e42d1ab6abd6919ce62.tar.gz gcc-2e9cc48c28941114a7b05e42d1ab6abd6919ce62.tar.bz2 |
match.c (gfc_match_stopcode): Permit error stop in pure procedures with F2015.
gcc/fortran/
2014-12-31 Tobias Burnus <burnus@net-b.de>
* match.c (gfc_match_stopcode): Permit error stop in pure
procedures with F2015.
gcc/testsuite/
2014-12-31 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/error_stop_3.f90: New.
* gfortran.dg/error_stop_4.f90: New.
* gfortran.dg/coarray_3.f90: Remove a dg-error.
From-SVN: r219127
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/match.c | 18 |
2 files changed, 19 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 10ad0bf..b102e31 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2014-12-31 Tobias Burnus <burnus@net-b.de> + + * match.c (gfc_match_stopcode): Permit error stop in pure + procedures with F2015. + 2014-12-31 Uros Bizjak <ubizjak@gmail.com> * trans-array.c (trans_array_bound_check): Use xasprintf instead diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index fb68eec..2b4202b 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2557,7 +2557,8 @@ gfc_match_cycle (void) } -/* Match a number or character constant after an (ALL) STOP or PAUSE statement. */ +/* Match a number or character constant after an (ERROR) STOP or PAUSE + statement. */ static match gfc_match_stopcode (gfc_statement st) @@ -2581,9 +2582,18 @@ gfc_match_stopcode (gfc_statement st) if (gfc_pure (NULL)) { - gfc_error ("%s statement not allowed in PURE procedure at %C", - gfc_ascii_statement (st)); - goto cleanup; + if (st == ST_ERROR_STOP) + { + if (!gfc_notify_std (GFC_STD_F2015, "%s statement at %C in PURE " + "procedure", gfc_ascii_statement (st))) + goto cleanup; + } + else + { + gfc_error ("%s statement not allowed in PURE procedure at %C", + gfc_ascii_statement (st)); + goto cleanup; + } } gfc_unset_implicit_pure (NULL); |