diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2018-01-23 19:13:10 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2018-01-23 19:13:10 +0000 |
commit | f59986b285e3dff07f847c5a680f6f9e0b9520f0 (patch) | |
tree | 20a49d1f50c5cd576ab30406aba52441d1cd1e32 | |
parent | 84ee745e333717fb3b64f66310499993c5ee1835 (diff) | |
download | gcc-f59986b285e3dff07f847c5a680f6f9e0b9520f0.zip gcc-f59986b285e3dff07f847c5a680f6f9e0b9520f0.tar.gz gcc-f59986b285e3dff07f847c5a680f6f9e0b9520f0.tar.bz2 |
re PR fortran/83866 (ICE in gfc_release_symbol, at fortran/symbol.c:3087)
2018-23-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83866
* decl.c (gfc_match_derived_decl): If eos not matched, recover
and emit error about garbage after declaration.
2018-23-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83866
* gfortran.dg/pdt_29.f03 : New test.
From-SVN: r256995
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pdt_29.f03 | 15 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f50d8a8..c477e96 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2018-23-01 Paul Thomas <pault@gcc.gnu.org> + PR fortran/83866 + * decl.c (gfc_match_derived_decl): If eos not matched, recover + and emit error about garbage after declaration. + +2018-23-01 Paul Thomas <pault@gcc.gnu.org> + PR fortran/83898 * trans-stmt.c (trans_associate_var): Do not set cst_array_ctor for characters. diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 710c6f7..7922eef 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -9857,7 +9857,10 @@ gfc_match_derived_decl (void) gfc_error_recovery (); m = gfc_match_eos (); if (m != MATCH_YES) - return m; + { + gfc_error_recovery (); + gfc_error_now ("Garbage after PARAMETERIZED TYPE declaration at %C"); + } sym->attr.pdt_template = 1; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d6e6709..c52b2d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-23-01 Paul Thomas <pault@gcc.gnu.org> + PR fortran/83866 + * gfortran.dg/pdt_29.f03 : New test. + +2018-23-01 Paul Thomas <pault@gcc.gnu.org> + PR fortran/83898 * gfortran.dg/associate_33.f03 : New test. diff --git a/gcc/testsuite/gfortran.dg/pdt_29.f03 b/gcc/testsuite/gfortran.dg/pdt_29.f03 new file mode 100644 index 0000000..596cc1c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pdt_29.f03 @@ -0,0 +1,15 @@ +! { dg-do compile } +! +! Test the fix for PR83866.f90 +! +! Contributed by G Steinmetz <gscfq@t-online.de> +! +program p + type private + end type + type t + class(t), pointer :: a + end type + type extends(t) :: t2 ! { dg-error "Garbage after | does not have a component" } + end type +end |