From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15102 invoked by alias); 16 Dec 2010 20:58:48 -0000 Received: (qmail 15077 invoked by uid 22791); 16 Dec 2010 20:58:47 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Dec 2010 20:58:45 +0000 From: "jason at gcc dot gnu.org" To: java-prs@gcc.gnu.org Subject: [Bug java/46983] New: Diagnostic about change in meaning of name in class misses some cases X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: java X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 16 Dec 2010 20:58:00 -0000 Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2010-q4/txt/msg00037.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46983 Summary: Diagnostic about change in meaning of name in class misses some cases Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: java AssignedTo: unassigned@gcc.gnu.org ReportedBy: jason@gcc.gnu.org CC: jason@gcc.gnu.org, rth@gcc.gnu.org In C++, it is ill-formed, no diagnostic required, for a lookup to have different meanings at the point of lookup and in the context of the complete class. G++ gives diagnostics about some instances of this, but misses this one: template struct A { typedef typename T::Y Z; }; struct B { typedef int Y; }; struct C: B { struct N: A { }; typedef char Y; }; int ar[sizeof(C::N::Z) == sizeof(int) ? 1 : -1]; Here when we instantiate A, C is not yet complete, so when we lookup C::Y we find B::Y. If we were to do the lookup in the full class, it would find C::Y instead.