Commit cb8e4445 by Janus Weil

re PR fortran/39876 (module procedure name that collides with the GNU intrinsic)

2009-05-08  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39876
	* intrinsic.c (gfc_is_intrinsic): Do not add the EXTERNAL attribute if
	the symbol is a module procedure.


2009-05-08  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39876
	* gfortran.dg/intrinsic_3.f90: New.

From-SVN: r147279
parent 3e807ffc
2009-05-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/39876
* intrinsic.c (gfc_is_intrinsic): Do not add the EXTERNAL attribute if
the symbol is a module procedure.
2009-05-08 Tobias Burnus <burnus@net-b.de>
* invoke.texi: Add do/recursion to the -fcheck= summary.
......
......@@ -836,13 +836,17 @@ gfc_is_intrinsic (gfc_symbol* sym, int subroutine_flag, locus loc)
/* See if this intrinsic is allowed in the current standard. */
if (gfc_check_intrinsic_standard (isym, &symstd, false, loc) == FAILURE)
{
if (gfc_option.warn_intrinsics_std)
gfc_warning_now ("The intrinsic '%s' at %L is not included in the"
" selected standard but %s and '%s' will be treated as"
" if declared EXTERNAL. Use an appropriate -std=*"
" option or define -fall-intrinsics to allow this"
" intrinsic.", sym->name, &loc, symstd, sym->name);
sym->attr.external = 1;
if (sym->attr.proc == PROC_UNKNOWN)
{
if (gfc_option.warn_intrinsics_std)
gfc_warning_now ("The intrinsic '%s' at %L is not included in the"
" selected standard but %s and '%s' will be"
" treated as if declared EXTERNAL. Use an"
" appropriate -std=* option or define"
" -fall-intrinsics to allow this intrinsic.",
sym->name, &loc, symstd, sym->name);
gfc_add_external (&sym->attr, &loc);
}
return false;
}
......
2009-05-08 Janus Weil <janus@gcc.gnu.org>
PR fortran/39876
* gfortran.dg/intrinsic_3.f90: New.
2009-05-07 Janis Johnson <janis187@us.ibm.com>
PR c/39037
......
! { dg-do compile }
! { dg-options "-std=f95" }
!
! PR 39876: module procedure name that collides with the GNU intrinsic
!
! Contributed by Alexei Matveev <alexei.matveev+gcc@gmail.com>
module p
implicit none
contains
subroutine test()
implicit none
print *, avg(erfc)
end subroutine test
function avg(f)
implicit none
double precision :: avg
interface
double precision function f(x)
implicit none
double precision, intent(in) :: x
end function f
end interface
avg = ( f(1.0D0) + f(2.0D0) ) / 2
end function avg
function erfc(x)
implicit none
double precision, intent(in) :: x
double precision :: erfc
erfc = x
end function erfc
end module p
! { dg-final { cleanup-modules "p" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment