diff options
author | Harald Anlauf <anlauf@gmx.de> | 2019-02-14 20:24:54 +0000 |
---|---|---|
committer | Harald Anlauf <anlauf@gcc.gnu.org> | 2019-02-14 20:24:54 +0000 |
commit | 14b693baa2ae60ab39944c58b5a0a898df616038 (patch) | |
tree | d9516b577a7fc71d25338416126e2651f27cab37 /gcc/fortran/symbol.c | |
parent | 26a8c34ec94a479266f641699dbc4a8b36bdfd30 (diff) | |
download | gcc-14b693baa2ae60ab39944c58b5a0a898df616038.zip gcc-14b693baa2ae60ab39944c58b5a0a898df616038.tar.gz gcc-14b693baa2ae60ab39944c58b5a0a898df616038.tar.bz2 |
re PR fortran/88248 ([F18] Bogus warning about obsolescent feature: Labeled DO statement)
2019-02-14 Harald Anlauf <anlauf@gmx.de>
PR fortran/88248
* symbol.c: Move check for labeled DO statement from
gfc_define_st_label to gfc_reference_st_label.
PR fortran/88248
* gfortran.dg/pr88248.f90: New test.
* gfortran.dg/f2018_obs.f90: Updated test.
From-SVN: r268895
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index b7408ac..c8a1f84 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2743,10 +2743,6 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type type, locus *label_locus) "DO termination statement which is not END DO" " or CONTINUE with label %d at %C", labelno)) return; - if (type == ST_LABEL_DO_TARGET - && !gfc_notify_std (GFC_STD_F2018_OBS, "Labeled DO statement " - "at %L", label_locus)) - return; break; default: @@ -2804,6 +2800,11 @@ gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type) "Shared DO termination label %d at %C", labelno)) return false; + if (type == ST_LABEL_DO_TARGET + && !gfc_notify_std (GFC_STD_F2018_OBS, "Labeled DO statement " + "at %L", &gfc_current_locus)) + return false; + if (lp->referenced != ST_LABEL_DO_TARGET) lp->referenced = type; rc = true; |