PR fortran/37254
PR fortran/39850
* interface.c (compare_parameter): Set implicit type for function
actual arguments with BT_UNKNOWN.
2009-06-22 Janus Weil <janus@gcc.gnu.org>
PR fortran/37254
PR fortran/39850
* gfortran.dg/interface_30.f90: Modified error message.
* gfortran.dg/proc_decl_22.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148816
138bc75d-0d04-0410-961f-
82ee72b054a4
+2009-06-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/37254
+ PR fortran/39850
+ * interface.c (compare_parameter): Set implicit type for function
+ actual arguments with BT_UNKNOWN.
+
2009-06-22 Tobias Burnus <burnus@net-b.de>
PR fortran/40472
}
if (formal->attr.function && !act_sym->attr.function)
- gfc_add_function (&act_sym->attr, act_sym->name, &act_sym->declared_at);
-
- if (formal->attr.subroutine && !act_sym->attr.subroutine)
+ {
+ gfc_add_function (&act_sym->attr, act_sym->name,
+ &act_sym->declared_at);
+ if (act_sym->ts.type == BT_UNKNOWN
+ && gfc_set_default_type (act_sym, 1, act_sym->ns) == FAILURE)
+ return 0;
+ }
+ else if (formal->attr.subroutine && !act_sym->attr.subroutine)
gfc_add_subroutine (&act_sym->attr, act_sym->name,
&act_sym->declared_at);
+2009-06-22 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/37254
+ PR fortran/39850
+ * gfortran.dg/interface_30.f90: Modified error message.
+ * gfortran.dg/proc_decl_22.f90: New.
+
2009-06-22 Ian Lance Taylor <iant@google.com>
* gcc.dg/Wcxx-compat-19.c: New testcase.
call sub1(func1)
call sub2(func2)
call sub1(func3)
- call sub2(func3) ! { dg-error "Type mismatch in argument" }
+ call sub2(func3) ! { dg-error "is not a subroutine" }
call sub2(func4)
- call sub1(func4) ! { dg-error "Interface mismatch in dummy procedure" }
+ call sub1(func4) ! { dg-error "is not a function" }
contains
subroutine sub1(a1)
interface
--- /dev/null
+! { dg-do compile }
+!
+! PR 37254: Reject valid PROCEDURE statement with implicit interface
+!
+! Original test case by Dominique d'Humieres <dominiq@lps.ens.fr>
+! Modified by Janus Weil <janus@gcc.gnu.org>
+
+ real function proc3( arg1 )
+ integer :: arg1
+ proc3 = arg1+7
+ end function proc3
+
+program myProg
+ PROCEDURE () :: proc3
+ call proc4( proc3 )
+
+contains
+
+ subroutine proc4( arg1 )
+ PROCEDURE(real) :: arg1
+ print*, 'the func: ', arg1(0)
+ end subroutine proc4
+
+end program myProg
+