From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25923 invoked by alias); 2 Feb 2004 01:31:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25916 invoked by alias); 2 Feb 2004 01:31:58 -0000 Date: Mon, 02 Feb 2004 01:31:00 -0000 Message-ID: <20040202013158.25915.qmail@sources.redhat.com> From: "gdr at integrable-solutions dot net" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040201233401.13967.gianni@mariani.ws> References: <20040201233401.13967.gianni@mariani.ws> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13967] [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules X-Bugzilla-Reason: CC X-SW-Source: 2004-02/txt/msg00105.txt.bz2 List-Id: ------- Additional Comments From gdr at integrable-solutions dot net 2004-02-02 01:31 ------- Subject: Re: [3.3?/3.4/3.5 regression] template template argument identifier lookup fails scoping rules "gianni at mariani dot ws" writes: | Gabriel Dos Reis writes: | || Nonetheless - it's still a boog. | | | |Where? in como or in GCC? | | .. I believe it's GCC that gets it wrong. If there is a bug in GCC, I think it is only about the wording of the diagnostic, not the fact of rejecting the code. | | .. Member functions defined in a class | | definition get rewritten as if they were defined outside of the class. | | And it is clear that when you rewrite the function outside of the | | class definition (which is what GCC does), then you find X::C, not the | | template parameter. | | But when it gets expanded, there should be no "X::C" symbol in the template | whatsoever as this is should be substituted with the template parameter. Did I | miss somthing ? I'm not talking about the instantiation. I'm talking about the definition. E.g. when you write struct X { struct C { int x; }; template class C> C Func() { return C(); } }; It gets rewritten as struct X { struct C; template class C> C Func(); }; struct A::C { int x; }; template class C> C X::Func() { return C(); // #1 } and at line #1, the standard says that X::C should be found. -- Gaby -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13967