From: Daniel Franke Date: Fri, 22 Jun 2007 18:33:35 +0000 (-0400) Subject: re PR fortran/31473 (gfortran does not detect duplicate EXTERNAL or INTRINSIC declara... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=23bc73b56313bcae5095f1258710bd1485ead15d;p=platform%2Fupstream%2Fgcc.git re PR fortran/31473 (gfortran does not detect duplicate EXTERNAL or INTRINSIC declarations) 2007-06-22 Daniel Franke PR fortran/31473 * symbol.c (gfc_copy_attr): Emit errors for duplicate EXTERNAL/INTRINSIC statements. From-SVN: r125954 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f323886..d0cbd0a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-06-22 Daniel Franke + + PR fortran/31473 + * symbol.c (gfc_copy_attr): Emit errors for duplicate + EXTERNAL/INTRINSIC statements. + 2007-06-22 Jerry DeLisle PR fortran/32360 diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 5215c3e..3c11b64 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1436,14 +1436,11 @@ gfc_copy_attr (symbol_attribute * dest, symbol_attribute * src, locus * where) goto fail; if (src->cray_pointee && gfc_add_cray_pointee (dest, where) == FAILURE) goto fail; - - /* The subroutines that set these bits also cause flavors to be set, - and that has already happened in the original, so don't let it - happen again. */ - if (src->external) - dest->external = 1; - if (src->intrinsic) - dest->intrinsic = 1; + + if (src->external && gfc_add_external (dest, where) == FAILURE) + goto fail; + if (src->intrinsic && gfc_add_intrinsic (dest, where) == FAILURE) + goto fail; return SUCCESS;