home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16473 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.6 KB  |  110 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!wupost!gumby!destroyer!ncar!csn!news.den.mmc.com!jones@pogo.den.mmc.com
  3. From: jones@pogo.den.mmc.com (Jonathan Jones)
  4. Subject: Virtual Destructor Problem - Help
  5. Message-ID: <1992Nov17.224416.8961@den.mmc.com>
  6. Sender: news@den.mmc.com (News)
  7. Nntp-Posting-Host: 129.243.25.14
  8. Organization: Martin Marietta WIS
  9. Date: Tue, 17 Nov 1992 22:44:16 GMT
  10. Lines: 98
  11.  
  12.  
  13.  *********************  Operating Enviroment **********************
  14.  
  15.    Running on a Macintosh IIfx
  16.                 System 7
  17.                 8 meg. of memory
  18.  
  19.                 MPW 3.2  -- E.T.O # 8 
  20.  
  21.    
  22.    We sent this problem to Apple by mail about 3 weeks ago, and to their Cplus.Bugs@AppleLink.Apple.Com a week ago.
  23.    We have heard no response.  Is this the Norm for Apple ?  
  24.    
  25.    We would like to know if other people can reproduce the following problem ? 
  26.    Does anyone have ANY solution to it ?
  27.      
  28.  
  29. ****************************  Problem   **************************************************
  30.  
  31.   Put in either "virtual" or both "virtual"s on the destructors and the compiler will fail!!
  32.  
  33.   It will only compile, if "virtual" is removed from BOTH destructors.
  34.  
  35.  
  36.    
  37.  
  38. *************   Stripped Down Source Code  *** Note: No Include File for this small Example  ***
  39.  
  40. class Object
  41. {
  42. public:
  43.     virtual  ~Object( void ) {}    
  44. };
  45.  
  46.  
  47. class Bool : public Object
  48. {
  49. public:
  50.     virtual ~Bool( void ) {}
  51. };
  52.  
  53.  
  54. void f3() 
  55. {
  56.     Bool *p  = new Bool[10];
  57.     
  58.     delete [] p;      // no size necessary
  59. }
  60.  
  61.  
  62. *********************  Compile line   ****************************
  63.  
  64.       CPlus   fileName.cpp   
  65.  
  66.  
  67.  
  68.  
  69. *********************  Output from C compiler, gets past Cfront ****************************
  70. #
  71. #
  72. #?
  73. ### Error 211 Pointer type required
  74. #?
  75. ### Error 24 ')' expected
  76. #?
  77. ### Error 229 mismatch between formal and actual parameter types
  78. #?
  79. ### Error 258 There are not enough arguments
  80. #?
  81. ### Error 30 ';' expected
  82. #?
  83. ### Error 22 error in factor
  84. #?
  85. ### Error 212 Struct or Union type required
  86. #?
  87. ### Error 23 identifier not declared
  88. #--------------------------------------------------------------------------------------------------------------------------------
  89.     File "HD:Cams:Tree:jjj.cpp"; Find Ñ!246:ñ!1; Open "{Target}"
  90. #--------------------------------------------------------------------------------------------------------------------------------
  91.  
  92.  
  93.  
  94.  
  95.  
  96. ********************************************************************************* 
  97. *
  98. *   From :     Steve McCabe & Jonathan Jones
  99. *              (303) 971-5124  (303) 971-5101
  100. *
  101. *   Reply to : /s=McCabe/g=Steve/ou=msmail/o=den.mmag/prmd=mmc/admd=telemail/c=us/@x400
  102. *
  103. *********************************************************************************
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.