From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5338 invoked by alias); 15 Jan 2002 13:36:04 -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 5323 invoked by uid 71); 15 Jan 2002 13:36:02 -0000 Date: Tue, 15 Jan 2002 05:36:00 -0000 Message-ID: <20020115133602.5321.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Andrew Pinski Subject: Re: c++/5387: g++ fails to catch use of private type in template Reply-To: Andrew Pinski X-SW-Source: 2002-01/txt/msg00560.txt.bz2 List-Id: The following reply was made to PR c++/5387; it has been noted by GNATS. From: Andrew Pinski To: Jason Merrill Cc: gcc-gnats@gcc.gnu.org Subject: Re: c++/5387: g++ fails to catch use of private type in template Date: Tue, 15 Jan 2002 08:32:09 -0500 All of the gcc compliers I tried fails and produces a message of (gcc version 3.1 20020114 (experimental), gcc version 3.0.4 20011213 (prerelease)) cccTestTempletePrivate.cc: In method `int A::f () [with T = B]': cccTestTempletePrivate.cc:14: instantiated from here cccTestTempletePrivate.cc:8: `int B::i' is private cccTestTempletePrivate.cc:3: within this context or of(gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)) : cccTestTempletePrivate.cc: In method `int A::f()': cccTestTempletePrivate.cc:14: instantiated from here cccTestTempletePrivate.cc:3: member `i' is a private member of class `B' so even the redhat compiler (gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)) complains with cccTestTempletePrivate.cc: In method `int A::f () [with T = B]': cccTestTempletePrivate.cc:14: instantiated from here cccTestTempletePrivate.cc:8: `int B::i' is private cccTestTempletePrivate.cc:3: within this context So please close this report since this was never a problem. Thanks, Andrew Pinski On Tuesday, January 15, 2002, at 08:13 , Jason Merrill wrote: > >> Number: 5387 >> Category: c++ >> Synopsis: g++ fails to catch use of private type in template >> Confidential: no >> Severity: non-critical >> Priority: low >> Responsible: unassigned >> State: open >> Class: accepts-illegal >> Submitter-Id: net >> Arrival-Date: Tue Jan 15 05:16:01 PST 2002 >> Closed-Date: >> Last-Modified: >> Originator: Jason Merrill >> Release: unknown-1.0 >> Organization: > redhat >> Environment: > System: Linux prospero.cambridge.redhat.com 2.4.13-0.5 #1 Sat Nov 3 > 15:08:02 EST 2001 i686 unknown > Architecture: i686 > > >> Description: > In the testcase below, g++ fails to diagnose the use of B::X in > the definition > of A::x. > >> How-To-Repeat: > > template struct A { > typename T::X x; > int f() { return T::i; } > }; > > class B { > typedef int X; > static int i; > }; > > int main() > { > A ab; > ab.f(); > } > >> Fix: > >> Release-Note: >> Audit-Trail: >> Unformatted: > >