Article View: gnu.g++.bug
Article #1219pointers to class data members don't work
From: dcb
Date: Thu, 19 Nov 1992 22:12
Date: Thu, 19 Nov 1992 22:12
35 lines
1137 bytes
1137 bytes
Hello there,
Given the following code,
class A
{
public :
A() ;
~A() ;
private :
int a ;
int b ;
typedef int A::* pm ;
struct A1
{
pm p ;
} ;
static A1 tbl[] ;
} ;
A::A1
A::tbl[ 2 ] =
{ &A::a ,
&A::b } ;
then it looks legal to me, and most of the compilers I have agree with
this opinion. However, Gcc 2.3.1 produces the following
kanze28.cc:20: error: invalid initializer
kanze28.cc:14: error: storage size of `tbl' isn't known
Regards
David C Binderman Dept US/ESI, Bau 60, SEL-Alcatel AG, Lorenz Strasse 10,
D-7000 Stuttgart 40, Germany dcb@us-es.sel.de Tel: +49 711 821 3841
Technical Details
Message-ID:
<9211192012.AA17422@us-es.sel.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!us-es.SEl.DE!dcbShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!us-es.SEl.DE!dcb From: dcb@us-es.SEl.DE Subject: pointers to class data members don't work Message-ID: <9211192012.AA17422@us-es.sel.de> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Thu, 19 Nov 1992 22:12:54 GMT Approved: bug-g++@prep.ai.mit.edu Lines: 36