From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29060 invoked by alias); 5 Apr 2002 17:46:03 -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 29023 invoked by uid 71); 5 Apr 2002 17:46:01 -0000 Resent-Date: 5 Apr 2002 17:46:01 -0000 Resent-Message-ID: <20020405174601.29022.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, reichelt@igpm.rwth-aachen.de Received:(qmail 28180 invoked by uid 61); 5 Apr 2002 17:42:52 -0000 Message-Id:<20020405174252.28179.qmail@sources.redhat.com> Date: Fri, 05 Apr 2002 09:46:00 -0000 From: reichelt@igpm.rwth-aachen.de Reply-To: reichelt@igpm.rwth-aachen.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/6190: T::C.X is accepted, although it should read T::C::X X-SW-Source: 2002-04/txt/msg00378.txt.bz2 List-Id: >Number: 6190 >Category: c++ >Synopsis: T::C.X is accepted, although it should read T::C::X >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Fri Apr 05 09:46:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Volker Reichelt >Release: gcc version 3.1 20020325 (prerelease) >Organization: >Environment: i686-pc-linux-gnu, mips-sgi-irix6.5 >Description: The following code, although illegal, is accepted by g++ (even with -Wall -W -pedantic turned on): ----------------------------snip here----------- struct A { enum { X=4 }; }; struct B { typedef A C; }; template int foo () { return T::C.X; } // wrong, should be T::C::X int main() { return foo(); } ----------------------------snip here----------- Note that the correct version is also accepted by g++. (This is at least better than 2.95.x and 3.0.x which accepted the illegal version and rejected the legal one.) B::C.X is rejected as it should be. >How-To-Repeat: g++ bug.cpp >Fix: >Release-Note: >Audit-Trail: >Unformatted: