home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / gnu / g / bug / 1846 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.1 KB  |  49 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!us-es.SEl.DE!dcb
  3. From: dcb@us-es.SEl.DE
  4. Subject: pointers to class data members don't work
  5. Message-ID: <9211192012.AA17422@us-es.sel.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Thu, 19 Nov 1992 22:12:54 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 36
  12.  
  13. Hello there,
  14.  
  15. Given the following code,
  16.  
  17. class A
  18. {
  19. public :
  20.         A() ;
  21.         ~A() ;
  22. private :
  23.         int a ;
  24.         int b ;
  25.         typedef int A::* pm ;
  26.         struct A1
  27.         {
  28.                 pm p ;
  29.         } ;
  30.         static A1       tbl[] ;
  31. } ;
  32.  
  33. A::A1           
  34. A::tbl[ 2 ] = 
  35. { &A::a  , 
  36.      &A::b  } ;
  37.  
  38. then it looks legal to me, and most of the compilers I have agree with
  39. this opinion. However, Gcc 2.3.1 produces the following
  40.  
  41. kanze28.cc:20: error: invalid initializer
  42. kanze28.cc:14: error: storage size of `tbl' isn't known
  43.  
  44. Regards
  45.  
  46. David C Binderman     Dept US/ESI, Bau 60, SEL-Alcatel AG, Lorenz Strasse 10,
  47. D-7000 Stuttgart 40, Germany      dcb@us-es.sel.de   Tel: +49 711 821 3841
  48.  
  49.