+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
}
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 (;;)
{
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)
+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.
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" }
--- /dev/null
+! { 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