re PR fortran/33229 (ICE with "intrinsic" plus calling a subroutine as function)

2008-09-06  Steven G. Kargl  <kargls@comcast.net>

        PR fortran/33229
        * resolve.c (resolve_function): An intrinsic subroutine should
        * not be
        called as a function.

2008-09-06  Steven G. Kargl  <kargls@comcast.net>

        PR fortran/33229
        * gfortran.dg/intrinsic_subroutine.f90: New test.

From-SVN: r140061
This commit is contained in:
Steven G. Kargl 2008-09-06 17:11:29 +02:00 committed by Tobias Burnus
parent 9731c4a348
commit 2c68bc89b7
4 changed files with 31 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2008-09-06 Steven G. Kargl <kargls@comcast.net>
PR fortran/33229
* resolve.c (resolve_function): An intrinsic subroutine should not be
called as a function.
2008-09-05 Daniel Kraft <d@domob.eu>
PR fortran/35837

View File

@ -2204,6 +2204,16 @@ resolve_function (gfc_expr *expr)
if (expr->symtree)
sym = expr->symtree->n.sym;
if (sym && sym->attr.intrinsic
&& !gfc_find_function (sym->name)
&& gfc_find_subroutine (sym->name)
&& sym->attr.function)
{
gfc_error ("Intrinsic subroutine '%s' used as "
"a function at %L", sym->name, &expr->where);
return FAILURE;
}
if (sym && sym->attr.flavor == FL_VARIABLE)
{
gfc_error ("'%s' at %L is not a function", sym->name, &expr->where);

View File

@ -1,3 +1,8 @@
2008-09-06 Steven G. Kargl <kargls@comcast.net>
PR fortran/33229
* gfortran.dg/intrinsic_subroutine.f90: New test.
2008-09-06 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.target/mips/mips.exp (dg-mips-options): Make
@ -26,8 +31,8 @@
2008-09-05 Douglas Gregor <doug.gregor@gmail.com>
PR c++/37342
* g++.dg/other/canon-37342.C: New.
PR c++/37342
* g++.dg/other/canon-37342.C: New.
2008-09-05 Joseph Myers <joseph@codesourcery.com>
@ -213,7 +218,7 @@
2008-09-02 Victor Kaplansky <victork@il.ibm.com>
* gcc.dg/fastmath-2.c: New.
2008-09-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37095

View File

@ -0,0 +1,7 @@
! { dg-do compile }
! PR 33229
implicit none
intrinsic cpu_time
real :: time
print *, CPU_TIME(TIME) ! { dg-error "Intrinsic subroutine" }
end