From patchwork Tue Jun 22 20:35:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 56566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 89CF5B6F14 for ; Wed, 23 Jun 2010 06:36:10 +1000 (EST) Received: (qmail 17726 invoked by alias); 22 Jun 2010 20:36:08 -0000 Received: (qmail 17716 invoked by uid 22791); 22 Jun 2010 20:36:07 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jun 2010 20:36:03 +0000 Received: from hpaq7.eem.corp.google.com (hpaq7.eem.corp.google.com [172.25.149.7]) by smtp-out.google.com with ESMTP id o5MKa08R014765 for ; Tue, 22 Jun 2010 13:36:00 -0700 Received: from pvc7 (pvc7.prod.google.com [10.241.209.135]) by hpaq7.eem.corp.google.com with ESMTP id o5MKZRH5026909 for ; Tue, 22 Jun 2010 13:35:59 -0700 Received: by pvc7 with SMTP id 7so1153576pvc.22 for ; Tue, 22 Jun 2010 13:35:59 -0700 (PDT) Received: by 10.114.18.7 with SMTP id 7mr6320872war.127.1277238959327; Tue, 22 Jun 2010 13:35:59 -0700 (PDT) Received: from coign.google.com (dhcp-172-22-126-240.mtv.corp.google.com [172.22.126.240]) by mx.google.com with ESMTPS id n29sm24891743wae.4.2010.06.22.13.35.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 22 Jun 2010 13:35:58 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [gccgo] Fix bug importing package with same name as current package From: Ian Lance Taylor Date: Tue, 22 Jun 2010 13:35:51 -0700 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch fixes a bug when importing a package whose name is the same as the current package, but which lives in a different directory. Committed to gccgo branch. Ian diff -r fafa9c01a826 go/gogo.cc --- a/go/gogo.cc Tue Jun 22 11:37:46 2010 -0700 +++ b/go/gogo.cc Tue Jun 22 13:31:02 2010 -0700 @@ -443,7 +443,8 @@ { // FIXME: Now that we compile packages as a whole, should we permit // importing the current package? - if (this->package_name() == real_name) + if (this->package_name() == real_name + && this->unique_prefix() == unique_prefix) { *padd_to_globals = false; if (!alias_arg.empty() && alias_arg != ".")