+2016-09-10 Paul Thomas <pault@gcc.gnu.org>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/77532
+ ^ interface.c (check_dtio_arg_TKR_intent): Return after error.
+ (check_dtio_interface1): Remove asserts, test for NULL and return
+ if found.
+
2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77420
int kind, int rank, sym_intent intent)
{
if (fsym->ts.type != type)
- gfc_error ("DTIO dummy argument at %L must be of type %s",
- &fsym->declared_at, gfc_basic_typename (type));
+ {
+ gfc_error ("DTIO dummy argument at %L must be of type %s",
+ &fsym->declared_at, gfc_basic_typename (type));
+ return;
+ }
if (fsym->ts.type != BT_CLASS && fsym->ts.type != BT_DERIVED
&& fsym->ts.kind != kind)
{
/* Typebound DTIO binding. */
tb_io_proc = tb_io_st->n.tb;
- gcc_assert (tb_io_proc != NULL);
+ if (tb_io_proc == NULL)
+ return;
+
gcc_assert (tb_io_proc->is_generic);
gcc_assert (tb_io_proc->u.generic->next == NULL);
specific_proc = tb_io_proc->u.generic->specific;
- gcc_assert (!specific_proc->is_generic);
+ if (specific_proc == NULL || specific_proc->is_generic)
+ return;
dtio_sub = specific_proc->u.specific->n.sym;
}
else
{
generic_proc = tb_io_st->n.sym;
- gcc_assert (generic_proc);
- gcc_assert (generic_proc->generic);
+ if (generic_proc == NULL || generic_proc->generic == NULL)
+ return;
for (intr = tb_io_st->n.sym->generic; intr; intr = intr->next)
{
--- /dev/null
+! { dg-do compile }
+!
+! Test fixes for PRs77532-4.
+!
+! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+!
+! PR77532 - used to ICE
+module m1
+ type t
+ end type
+ interface read(unformatted)
+ end interface
+end
+
+! PR77533 - used to ICE after error
+module m2
+ type t
+ type(unknown), pointer :: next ! { dg-error "is a type that has not been declared" }
+ contains
+ procedure :: s
+ generic :: write(formatted) => s
+ end type
+contains
+ subroutine s(x)
+ end
+end
+
+! PR77533 comment #1 - gave warning that
+module m3
+ type t
+ contains
+ procedure :: s ! { dg-error "Non-polymorphic passed-object" }
+ generic :: write(formatted) => s
+ end type
+contains
+ subroutine s(x) ! { dg-error "must be of type CLASS" }
+ class(t), intent(in) : x ! { dg-error "Invalid character in name" }
+ end
+end