From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13007 invoked by alias); 9 Jan 2013 13:54:40 -0000 Received: (qmail 12948 invoked by uid 48); 9 Jan 2013 13:54:17 -0000 From: "mikael at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/53537] [4.6/4.7/4.8 Regression] Explicit IMPORT of renamed USE-associated symbol fails Date: Wed, 09 Jan 2013 13:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mikael at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2013-01/txt/msg00798.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53537 --- Comment #5 from Mikael Morin 2013-01-09 13:54:15 UTC --- Created attachment 29124 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29124 "Fix" for the regression in comment #3 For the remaining problem: (In reply to comment #3) > The patch of comment 1 fails for testsuite/gfortran.dg/import7.f90: > > TYPE(T3) X > 1 > Error: The type of 'x' at (1) has not been declared within the interface maybe we can just remove the error. After all, there is already non-interface-specific code to diagnose uses of undeclared types. For that code to trigger in place of the error above, a few adjustments are needed to avoid searching the type outside the interface (so that the type is really not found). With the attached patch, comment #0, comment #1 and comment #4 are accepted, but a few adjustments are needed in the testsuite: from: type(fcnparms) :: fparams ! { dg-error "not been declared within the in 1 Error: The type of 'fparams' at (1) has not been declared within the interface to: type(fcnparms) :: fparams ! { dg-error "not been declared within the in 1 Error: Derived type 'fcnparms' at (1) is being used before it is defined I will test the patch against the full testsuite. As it touches the core of the symbol resolution, it's quite to be expected that it has "interesting" side effects.