From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8050 invoked by alias); 20 Nov 2002 19: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 8027 invoked by uid 71); 20 Nov 2002 19:46:01 -0000 Resent-Date: 20 Nov 2002 19:46:01 -0000 Resent-Message-ID: <20021120194601.8026.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, martin@xemacs.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, reichelt@igpm.rwth-aachen.de Received: (qmail 6766 invoked by uid 61); 20 Nov 2002 19:41:43 -0000 Message-Id: <20021120194143.6765.qmail@sources.redhat.com> Date: Thu, 28 Nov 2002 16:35:00 -0000 From: reichelt@igpm.rwth-aachen.de Reply-To: reichelt@igpm.rwth-aachen.de To: gcc-gnats@gcc.gnu.org Cc: martin@xemacs.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) X-GNATS-Notify: martin@xemacs.org Subject: c++/8662: [3.2 regression] illegal access of private member of unnamed class X-SW-Source: 2002-11/txt/msg01132.txt.bz2 List-Id: >Number: 8662 >Category: c++ >Synopsis: [3.2 regression] illegal access of private member of unnamed class >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Wed Nov 20 11:46:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Martin Buchholz, Volker Reichelt >Release: 3.2-branch, mainline >Organization: >Environment: target independent >Description: The following code should be rejected, since a.i is a private member: ------------------snip here----------------------- class { int i; } a; void foo () { a.i; } ------------------snip here----------------------- gcc 2.95.x and 3.0.x correctly reject the code, however it is accepted with the 3.2-branch and mainline. BTW, all version reject the code if private is explicitly specified: class { private: int i; } a; or the class has a name: class A { int i; } a; The PR was distilled from Martin Buchholz's message: http://gcc.gnu.org/ml/gcc-bugs/2002-11/msg01022.html >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: