home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / g / bug / 2304 next >
Encoding:
Text File  |  1993-01-21  |  1.6 KB  |  75 lines

  1. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!siiks_a1.bosch.DE!K3EES4_SU
  2. From: K3EES4_SU@siiks_a1.bosch.DE
  3. Newsgroups: gnu.g++.bug
  4. Subject: G++
  5. Date: 21 Jan 1993 18:03:47 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 62
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-g++@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <01GTRUMWONTE0007YD@XLINK2.IRA.UKA.DE>
  12.  
  13. From:    NAME: K3/EES4-Schulz Kay            
  14.     FUNC: K3/EES4                         
  15.     TEL: 0711/811-20993                   <K3EES4_SU@SIIKS_A1@SIIKS>
  16. To:    in%"gnu-g++@prep.ai.mit.edu"@gxlink
  17.  
  18. Dear Ladies and Gentlemen,
  19. I am developping on an Ultrix 4.2 and I use your 
  20. g++ 1.4
  21. and gcc 2.1
  22.  
  23. I can't read news so I have a question if the following is a 
  24. bug of this old version or not!
  25.  
  26. I have a base class and a derived class. I use destructors:
  27. e.g.
  28. class A
  29. {
  30.     A(); //Constr.
  31.     virtual ~A(); //DESTR.
  32.     //body
  33. }
  34. class B:public A
  35. {
  36.     B();    //Constr.
  37.     ~B():    //Destr.
  38.     //more code
  39. }
  40. Stroustrup says this should work, it produces the following output:
  41. _$_8A
  42. _$_20B
  43.  
  44. Why?
  45. If I use this:
  46. class A
  47. {
  48.     A();
  49.     ~A();
  50.     //virtual functions following
  51. }
  52. class B
  53. {
  54.     B();
  55.     //code for virtual functions in class a or definition
  56. }
  57. I get the output:
  58. warning: class A has virtual functions but non-virtual destructor.
  59.  
  60. I need help, else I can't go on working, or only withou
  61. destructors . Is a bug of your compiler or linker and is fixed
  62. in the newer versions or is it a feature or is it correct?
  63.  
  64. Thanks
  65.  
  66. KAY SCHULZ
  67. k3ees4_su@siiks_a1.bosch.de
  68. Falkenweg 9
  69. 7120 Bietigheim-Bissingen
  70. GERMANY
  71. Tel. private: 0049714265643
  72. Tel. Job: 004971181120993
  73.  
  74.  
  75.