Commit b050b2de by Tobias Burnus Committed by Tobias Burnus

re PR fortran/40041 (spurious warning with INTRINSIC statement)

2009-05-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40041
        * resolve.c (resolve_symbol): Print no warning for implicitly
        typed intrinsic functions.

2009-05-06  Tobias Burnus  <burnus@net-b.de>

        PR fortran/40041
        * gfortran.dg/intrinsic_2.f90: New test.
        * gfortran.dg/intrinsic.f90: Add old and this PR as comment.

From-SVN: r147183
parent 1f110335
2009-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/40041
* resolve.c (resolve_symbol): Print no warning for implicitly
typed intrinsic functions.
2009-05-05 Janus Weil <janus@gcc.gnu.org> 2009-05-05 Janus Weil <janus@gcc.gnu.org>
PR fortran/39998 PR fortran/39998
......
...@@ -9320,13 +9320,14 @@ resolve_symbol (gfc_symbol *sym) ...@@ -9320,13 +9320,14 @@ resolve_symbol (gfc_symbol *sym)
if ((isym = gfc_find_function (sym->name))) if ((isym = gfc_find_function (sym->name)))
{ {
if (sym->ts.type != BT_UNKNOWN && gfc_option.warn_surprising) if (sym->ts.type != BT_UNKNOWN && gfc_option.warn_surprising
&& !sym->attr.implicit_type)
gfc_warning ("Type specified for intrinsic function '%s' at %L is" gfc_warning ("Type specified for intrinsic function '%s' at %L is"
" ignored", sym->name, &sym->declared_at); " ignored", sym->name, &sym->declared_at);
} }
else if ((isym = gfc_find_subroutine (sym->name))) else if ((isym = gfc_find_subroutine (sym->name)))
{ {
if (sym->ts.type != BT_UNKNOWN) if (sym->ts.type != BT_UNKNOWN && !sym->attr.implicit_type)
{ {
gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type" gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type"
" specifier", sym->name, &sym->declared_at); " specifier", sym->name, &sym->declared_at);
......
2009-05-06 Tobias Burnus <burnus@net-b.de>
PR fortran/40041
* gfortran.dg/intrinsic_2.f90: New test.
* gfortran.dg/intrinsic.f90: Add old and this PR as comment.
2009-05-06 Joseph Myers <joseph@codesourcery.com> 2009-05-06 Joseph Myers <joseph@codesourcery.com>
PR c/40032 PR c/40032
......
! { dg-do compile } ! { dg-do compile }
! { dg-options "-c -Wall" } ! { dg-options "-c -Wall" }
!
! PR fortran/20373
! cf. also PR fortran/40041
subroutine valid subroutine valid
intrinsic :: abs ! ok, intrinsic function intrinsic :: abs ! ok, intrinsic function
......
! { dg-do compile }
! { dg-options "-c -Wall" }
!
! PR fortran/40041
! cf. also PR fortran/20373
subroutine valid_one
REAL :: a
INTEGER :: n
INTRINSIC ABS, MAX
a(n) = MAX(ABS(2),ABS(3),n)
end subroutine
subroutine valid_two
IMPLICIT NONE
REAL :: a
INTEGER :: n
INTRINSIC ABS, MAX
a(n) = MAX(ABS(2),ABS(3),n)
end subroutine
subroutine warnings_one
REAL :: a
INTEGER :: n
REAL :: ABS ! { dg-warning "Type specified for intrinsic function" }
REAL :: MAX ! { dg-warning "Type specified for intrinsic function" }
INTRINSIC ABS, MAX
a(n) = MAX(ABS(2),ABS(3),n)
end subroutine
subroutine warnings_two
IMPLICIT NONE
REAL :: a
INTEGER :: n
INTRINSIC ABS ! { dg-warning "Type specified for intrinsic function" }
INTRINSIC MAX ! { dg-warning "Type specified for intrinsic function" }
REAL :: ABS
REAL :: MAX
a(n) = MAX(ABS(2),ABS(3),n)
end subroutine
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