]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/58793 (Wrong value for _vtab for intrinsic types with CLASS(*): storage...
authorTobias Burnus <burnus@net-b.de>
Wed, 23 Oct 2013 05:44:02 +0000 (07:44 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 23 Oct 2013 05:44:02 +0000 (07:44 +0200)
2013-10-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58793
        * interface.c (compare_parameter): Reject passing TYPE(*)
        to CLASS(*).

2013-10-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58793
        * gfortran.dg/assumed_type_8.f90: New.

From-SVN: r203945

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

index 3539d2cbebdda15cb84169ded3de2cc49cd725b1..def8b05c132a69eb952640fd50fbaa2df1e0621b 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-23  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/58793
+       * interface.c (compare_parameter): Reject passing TYPE(*)
+       to CLASS(*).
+
 2013-10-22  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran 57893
index b3ddf5f08b339716bb0aa6f72ca58d47da4e2ccf..0504c904b96d91f9783d244a21631f037f693aa8 100644 (file)
@@ -1972,6 +1972,15 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
       return 0;
     }
 
+  if (actual->ts.type == BT_ASSUMED && formal->ts.type != BT_ASSUMED)
+    {
+      if (where)
+       gfc_error ("Assumed-type actual argument at %L requires that dummy "
+                  "argument '%s' is of assumed type", &actual->where,
+                  formal->name);
+      return 0;
+    }
+
   /* F2008, 12.5.2.5; IR F08/0073.  */
   if (formal->ts.type == BT_CLASS && formal->attr.class_ok
       && actual->expr_type != EXPR_NULL
index 58639a21e7697ad4fdf615a7027e0add0d2fa66d..28a379e652132d4b9079599a935d10698ce030db 100644 (file)
@@ -1,3 +1,8 @@
+2013-10-23  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/58793
+       * gfortran.dg/assumed_type_8.f90: New.
+
 2013-10-22  Uros Bizjak  <ubizjak@gmail.com>
 
        PR target/58779
diff --git a/gcc/testsuite/gfortran.dg/assumed_type_8.f90 b/gcc/testsuite/gfortran.dg/assumed_type_8.f90
new file mode 100644 (file)
index 0000000..543e693
--- /dev/null
@@ -0,0 +1,19 @@
+! { dg-do compile }
+!
+! Issue came up during the review of PR fortran/58793
+!
+! Test for TS29113:2012's C407b.
+! 
+program test
+  use iso_c_binding
+  integer,target ::aa
+  call up(c_loc(aa))
+contains
+  subroutine up(x)
+    class(*) :: x
+  end subroutine
+  subroutine bar(x)
+   type(*) :: x
+   call up(x) ! { dg-error "Assumed-type actual argument at .1. requires that dummy argument 'x' is of assumed type" }
+  end subroutine bar
+end program test