🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1083

G++ 2.3.1 Nested Class Constructor Bug

#1083
From: Jeff Schultz
Date: Sat, 07 Nov 1992 02:14
24 lines
1074 bytes
The behavior below is a change from that of 2.2.2 and seems wrong to me.


	Jeff Schultz


------------------------------------------------------------------
Gcc 2.3.1 configured for 'decstation'.

class A {
public:
        int p;
        class B {
        public:
                B(A &a) { a.p = 23; }
                B(A *a) { a->p = 45; }
                void f(A &a) { a.p = 56; }
        };
};

g++ -c x.C
x.C: In method `B::B (class A&)':
x.C:6: assignment to non-static member `p' of enclosing class `A'
------------------------------------------------------------------
Technical Details
Message-ID: <26918.721023266@sevenoak.aaii.oz.AU>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aaii.oz.au!jws

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!aaii.oz.au!jws
From: jws@aaii.oz.au (Jeff Schultz)
Subject: G++ 2.3.1 Nested Class Constructor Bug
Message-ID: <26918.721023266@sevenoak.aaii.oz.AU>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 7 Nov 1992 02:14:26 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 25