re PR fortran/58023 ([F03] ICE on invalid with bad PPC declaration)
authorJanus Weil <janus@gcc.gnu.org>
Sun, 11 Jan 2015 19:13:24 +0000 (20:13 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 11 Jan 2015 19:13:24 +0000 (20:13 +0100)
2015-01-11  Janus Weil  <janus@gcc.gnu.org>

PR fortran/58023
* resolve.c (resolve_fl_derived0): Set error flag if problems with the
interface of a procedure-pointer component were detected.

2015-01-11  Janus Weil  <janus@gcc.gnu.org>

PR fortran/58023
* gfortran.dg/proc_ptr_comp_42.f90: New.

From-SVN: r219439

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/proc_ptr_comp_42.f90 [new file with mode: 0644]

index b525ff40ba8cb293b172bec282bf9ed8a5eab3aa..6f2e549c1b68b567b584002d1d0e39a8a7a3714d 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-11  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/58023
+       * resolve.c (resolve_fl_derived0): Set error flag if problems with the
+       interface of a procedure-pointer component were detected.
+
 2015-01-11  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/64508
index a0e32b1fa3283148acb2da7d6da2144b58fb5aac..6b2444324f7b235f53ac1824cec03a1d727bcbc6 100644 (file)
@@ -12424,9 +12424,11 @@ resolve_fl_derived0 (gfc_symbol *sym)
        {
          gfc_symbol *ifc = c->ts.interface;
 
-         if (!sym->attr.vtype
-             && !check_proc_interface (ifc, &c->loc))
-           return false;
+         if (!sym->attr.vtype && !check_proc_interface (ifc, &c->loc))
+           {
+             c->tb->error = 1;
+             return false;
+           }
 
          if (ifc->attr.if_source || ifc->attr.intrinsic)
            {
index a7c24ce0caa1edb8f7bc27d17617e87e20b39f67..4f729fd956922306ecb75038d79f7e9c71aff2c8 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-11  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/58023
+       * gfortran.dg/proc_ptr_comp_42.f90: New.
+
 2015-01-11  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/64508
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_42.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_42.f90
new file mode 100644 (file)
index 0000000..3773fae
--- /dev/null
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR 58023: [F03] ICE on invalid with bad PPC declaration
+!
+! Contributed by Andrew Benson <abensonca@gmail.com>
+
+  implicit none
+
+  type :: sfd
+    procedure(mr), pointer :: mr2  ! { dg-error "must be explicit" }
+  end type
+
+  type(sfd):: d
+  print *, d%mr2()
+
+end