2012-08-09 Tobias Burnus <burnus@net-b.de>
PR fortran/54199
* intrinsic.c (gfc_warn_intrinsic_shadow): Better warning
for internal procedures.
2012-08-09 Tobias Burnus <burnus@net-b.de>
PR fortran/54199
* gfortran.dg/intrinsic_shadow_4.f90: New.
@@ -4503,7 +4511,7 @@ gfc_warn_intrinsic_shadow (const gfc_symbol* sym, bool in_module, bool func)
return;
/* Emit the warning. */
- if (in_module)
+ if (in_module || sym->ns->proc_name)
gfc_warning ("'%s' declared at %L may shadow the intrinsic of the same"
" name. In order to call the intrinsic, explicit INTRINSIC"
" declarations may be required.",
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-Wall" }
+!
+! PR fortran/54199
+!
+subroutine test()
+contains
+ real function fraction(x) ! { dg-warning "'fraction' declared at .1. may shadow the intrinsic of the same name. In order to call the intrinsic, explicit INTRINSIC declarations may be required." }
+ real :: x
+ fraction = x
+ end function fraction
+end subroutine test