mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-16 08:00:29 +08:00
re PR fortran/89601 ([PDT] ICE: Segmentation fault (in resolve_component))
fix PR 89601 2019-03-13 Janus Weil <janus@gcc.gnu.org> PR fortran/89601 * decl.c (gfc_match_formal_arglist): Reject empty type parameter lists. (gfc_match_derived_decl): Mark as PDT only if type parameter list was matched successfully. 2019-03-13 Janus Weil <janus@gcc.gnu.org> PR fortran/89601 * gfortran.dg/pdt_16.f03: Modified to avoid follow-up errors. * gfortran.dg/pdt_30.f90: New test case. From-SVN: r269658
This commit is contained in:
parent
cbfa3ec327
commit
84083a711e
@ -1,3 +1,10 @@
|
||||
2019-03-13 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/89601
|
||||
* decl.c (gfc_match_formal_arglist): Reject empty type parameter lists.
|
||||
(gfc_match_derived_decl): Mark as PDT only if type parameter list was
|
||||
matched successfully.
|
||||
|
||||
2019-03-13 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/66695
|
||||
|
@ -6275,7 +6275,16 @@ gfc_match_formal_arglist (gfc_symbol *progname, int st_flag,
|
||||
}
|
||||
|
||||
if (gfc_match_char (')') == MATCH_YES)
|
||||
goto ok;
|
||||
{
|
||||
if (typeparam)
|
||||
{
|
||||
gfc_error_now ("A type parameter list is required at %C");
|
||||
m = MATCH_ERROR;
|
||||
goto cleanup;
|
||||
}
|
||||
else
|
||||
goto ok;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
@ -10217,13 +10226,14 @@ gfc_match_derived_decl (void)
|
||||
m = gfc_match_formal_arglist (sym, 0, 0, true);
|
||||
if (m != MATCH_YES)
|
||||
gfc_error_recovery ();
|
||||
else
|
||||
sym->attr.pdt_template = 1;
|
||||
m = gfc_match_eos ();
|
||||
if (m != MATCH_YES)
|
||||
{
|
||||
gfc_error_recovery ();
|
||||
gfc_error_now ("Garbage after PARAMETERIZED TYPE declaration at %C");
|
||||
}
|
||||
sym->attr.pdt_template = 1;
|
||||
}
|
||||
|
||||
if (extended && !sym->components)
|
||||
|
@ -1,3 +1,9 @@
|
||||
2019-03-13 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/89601
|
||||
* gfortran.dg/pdt_16.f03: Modified to avoid follow-up errors.
|
||||
* gfortran.dg/pdt_30.f90: New test case.
|
||||
|
||||
2019-03-13 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
PR c++/88979 - further P0634 fix for constructors.
|
||||
|
@ -12,7 +12,6 @@ end
|
||||
program p
|
||||
type t(a ! { dg-error "Expected parameter list" }
|
||||
integer, kind :: a
|
||||
real(a) :: x
|
||||
end type
|
||||
type u(a, a) ! { dg-error "Duplicate name" }
|
||||
integer, kind :: a ! { dg-error "already declared" }
|
||||
|
17
gcc/testsuite/gfortran.dg/pdt_30.f90
Normal file
17
gcc/testsuite/gfortran.dg/pdt_30.f90
Normal file
@ -0,0 +1,17 @@
|
||||
! { dg-do compile }
|
||||
!
|
||||
! PR 89601: [8/9 Regression] [PDT] ICE: Segmentation fault (in resolve_component)
|
||||
!
|
||||
! Contributed by Arseny Solokha <asolokha@gmx.com>
|
||||
|
||||
program vw
|
||||
interface
|
||||
real function ul (ki)
|
||||
real :: ki
|
||||
end function ul
|
||||
end interface
|
||||
type :: q8 () ! { dg-error "A type parameter list is required" }
|
||||
procedure (ul), pointer, nopass :: pj
|
||||
end type q8
|
||||
type (q8) :: ki
|
||||
end program vw
|
Loading…
x
Reference in New Issue
Block a user