From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18706 invoked by alias); 16 Nov 2002 01:36: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 18692 invoked by uid 71); 16 Nov 2002 01:36:01 -0000 Date: Thu, 21 Nov 2002 18:47:00 -0000 Message-ID: <20021116013601.18691.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Wolfgang Bangerth Subject: Re: c++/3907: nested template parm collides with member name Reply-To: Wolfgang Bangerth X-SW-Source: 2002-11/txt/msg00809.txt.bz2 List-Id: The following reply was made to PR c++/3907; it has been noted by GNATS. From: Wolfgang Bangerth To: gcc-bugs@gcc.gnu.org, Cc: Subject: Re: c++/3907: nested template parm collides with member name Date: Fri, 15 Nov 2002 19:32:58 -0600 (CST) The original testcase was a rejection of illegal code (because it accessed the nonexisting inner type U::S), but I can make this a rejects-legal this way: ----------------------------------------- template struct T { enum E { }; }; template struct U {}; template struct C { template struct S : U {}; typename T::E t; }; ----------------------------- tmp/g> /home/bangerth/bin/gcc-3.3x-pre/bin/c++ -c x.cc x.cc:6: error: declaration of `typename T::E C::t' x.cc:5: error: changes meaning of `t' from `int t' Of course, the scope of the template arg "t" should be limited to the end of the template class declaration. If someone is adventurous: the initial code accepted invalid code. I played with this further, and it is now PR 8596. Regards Wolfgang ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth