From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10191 invoked by alias); 9 Mar 2003 15:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10112 invoked by uid 71); 9 Mar 2003 15:56:01 -0000 Date: Sun, 09 Mar 2003 15:56:00 -0000 Message-ID: <20030309155601.10109.qmail@sources.redhat.com> To: nathan@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Nathan Sidwell Subject: Re: c++/9990: locale_facets.h contains invalid typedef Reply-To: Nathan Sidwell X-SW-Source: 2003-03/txt/msg00430.txt.bz2 List-Id: The following reply was made to PR c++/9990; it has been noted by GNATS. From: Nathan Sidwell To: paolo@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nasgaard@ca.ibm.com, nathan@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/9990: locale_facets.h contains invalid typedef Date: Sun, 09 Mar 2003 15:53:28 +0000 I can't tell if this is well formed or not. typename ctype::mask is looked up at instantiation time. Now does it find the typedef in ctype, or does it find the typedef in ctype_base? If this were not a template class, it would find the latter, ctype::mask not being in scope at the point of parsing the decl-spec. I believe class template instantiation should behave as closely as possible to the non-template equivalent. In which case the typename will find the name in the base class, and then insert the typedef into the instantiated class's scope. The standard doesn't specify precisely how instantiation happens. There are (sort of) two choices 1) build up the instantiated class and its members much like a non-template class definition is constructed. I.e. what I've described above 2) bind all the names declared, to types, functions, fields or whatever, then instantiate each of those declared things. IIRC gcc kind of does a mixture of the two :( Anyway, even if we do 1, do we fall foul of [3.3.6]/2? I think we do. note no diagnostic is required for such a violation. We also fail to issue one for the non-template case of N being a qualified id. Such as, struct B { typedef int X;}; struct C : B { typedef C::X Y; int X; }; I think this is really a 'request for change' nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC The voices in my head said this was stupid too nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org