From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11830 invoked by alias); 25 May 2008 14:03:16 -0000 Received: (qmail 11660 invoked by uid 48); 25 May 2008 14:02:23 -0000 Date: Sun, 25 May 2008 14:03:00 -0000 Message-ID: <20080525140223.11659.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/36325] specific or generic INTERFACE implies the EXTERNAL attribute In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jaydub66 at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg01857.txt.bz2 ------- Comment #1 from jaydub66 at gmail dot com 2008-05-25 14:02 ------- Here is a first patch: Index: gcc/fortran/symbol.c =================================================================== --- gcc/fortran/symbol.c (revision 135859) +++ gcc/fortran/symbol.c (working copy) @@ -439,7 +439,7 @@ check_conflict (symbol_attribute *attr, conf (external, intrinsic); conf (entry, intrinsic); - if ((attr->if_source && !attr->procedure) || attr->contained) + if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained) { conf (external, subroutine); conf (external, function); Index: gcc/fortran/parse.c =================================================================== --- gcc/fortran/parse.c (revision 135859) +++ gcc/fortran/parse.c (working copy) @@ -1917,12 +1917,26 @@ loop: new_state = COMP_SUBROUTINE; gfc_add_explicit_interface (gfc_new_block, IFSRC_IFBODY, gfc_new_block->formal, NULL); + if (current_interface.type != INTERFACE_ABSTRACT && + gfc_add_external (&gfc_new_block->attr, &gfc_current_locus) == FAILURE) + { + reject_statement (); + gfc_free_namespace (gfc_current_ns); + goto loop; + } break; case ST_FUNCTION: new_state = COMP_FUNCTION; gfc_add_explicit_interface (gfc_new_block, IFSRC_IFBODY, gfc_new_block->formal, NULL); + if (current_interface.type != INTERFACE_ABSTRACT && + gfc_add_external (&gfc_new_block->attr, &gfc_current_locus) == FAILURE) + { + reject_statement (); + gfc_free_namespace (gfc_current_ns); + goto loop; + } break; case ST_PROCEDURE: This removes the conflict between EXTERNAL and SUBROUTINE for this case, and adds the EXTERNAL attribute for a non-abstract INTERFACE statement. Checking for regressions ... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36325