First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 8662
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 8662 depends on: Show dependency tree
Show dependency graph
Bug 8662 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: Opened: 2002-11-20 11:46
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

Release:
3.2-branch, mainline

Environment:
target independent

------- Comment #1 From Volker Reichelt 2002-11-20 11:46 -------
Fix:
http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01348.html

------- Comment #2 From Volker Reichelt 2002-11-20 11:47 -------
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.

------- Comment #3 From Joe Buck 2002-11-21 17:11 -------
From: Joe Buck <jbuck@synopsys.com>
To: gcc-gnats@gcc.gnu.org, martin@xemacs.org, reichelt@igpm.rwth-aachen.de,
   gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c++/8662: [3.2 regression] illegal access of private member of
 unnamed class
Date: Thu, 21 Nov 2002 17:11:21 -0800

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8662
 
 See http://gcc.gnu.org/ml/gcc-patches/2002-11/msg01348.html
 for a proposed patch.
 

------- Comment #4 From Mark Mitchell 2002-11-29 17:54 -------
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed in GCC 3.3.

First Last Prev Next    No search results available      Search page      Enter new bug