re PR fortran/36459 (Wrong interface use for PROCEDURE)
authorJanus Weil <janus@gcc.gnu.org>
Sun, 8 Jun 2008 11:55:41 +0000 (13:55 +0200)
committerJanus Weil <janus@gcc.gnu.org>
Sun, 8 Jun 2008 11:55:41 +0000 (13:55 +0200)
2008-06-08  Janus Weil  <janus@gcc.gnu.org>

PR fortran/36459
* decl.c (match_procedure_decl): Correctly recognize if the interface
is an intrinsic procedure.

2008-06-08  Janus Weil  <janus@gcc.gnu.org>

PR fortran/36459
* gfortran.dg/proc_decl_16.f90: New.

From-SVN: r136555

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

index 9c950697ddacdf94c8c21a8377c5ea1f51cb7536..205fc19f0c6c97e16e9b9fff0ab88dc61cea0e2e 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-08  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/36459
+       * decl.c (match_procedure_decl): Correctly recognize if the interface
+       is an intrinsic procedure.
+
 2008-06-08  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/35830
index ea87c211d4938677847e9ddc4e2773e7a65ff51b..c4ef7e7004d8fe69dfc7e4f7b7ae5915ef530a09 100644 (file)
@@ -4085,8 +4085,10 @@ match_procedure_decl (void)
          return MATCH_ERROR;
        }
       /* Handle intrinsic procedures.  */
-      if (gfc_intrinsic_name (proc_if->name, 0)
-         || gfc_intrinsic_name (proc_if->name, 1))
+      if (!(proc_if->attr.external || proc_if->attr.use_assoc
+           || proc_if->attr.if_source == IFSRC_IFBODY)
+         && (gfc_intrinsic_name (proc_if->name, 0)
+             || gfc_intrinsic_name (proc_if->name, 1)))
        proc_if->attr.intrinsic = 1;
       if (proc_if->attr.intrinsic
          && !gfc_intrinsic_actual_ok (proc_if->name, 0))
index d6a0c031e3920da175a2eca5530a513bf4c51eed..84ee84ca0a9324f2557696506992966a6c282b9a 100644 (file)
@@ -1,3 +1,8 @@
+2008-06-08  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/36459
+       * gfortran.dg/proc_decl_16.f90: New.
+       
 2008-06-08  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/35830
diff --git a/gcc/testsuite/gfortran.dg/proc_decl_16.f90 b/gcc/testsuite/gfortran.dg/proc_decl_16.f90
new file mode 100644 (file)
index 0000000..3251e52
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do compile }
+! PR fortran/36459
+!
+abstract interface
+  function dim()
+    integer :: dim
+  end function dim
+end interface
+procedure(dim) :: f
+
+interface
+  integer function tan()
+  end function
+end interface
+procedure(tan) :: g
+
+print *, f()
+
+print *, tan()
+
+end