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

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!umn.edu!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!stc.lockheed.COM!teague
  3. From: teague@stc.lockheed.COM (Alan Teague)
  4. Subject: Nested Classes Problem
  5. Message-ID: <9211170255.AA08964@stc.lockheed.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Tue, 17 Nov 1992 02:55:00 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 30
  12.  
  13. The following code causes the compile to crash.  If it doesn't cause your
  14. compiler to crash also, then please let me know so that I can check the 
  15. installation and building of the one here.
  16.  
  17. Under g++ 1.40.3 this code generates the error message:
  18.     multiple `::' terms in declarator invalid
  19. But I could work around it by dropping the "enclose::" part of the
  20. destructor definition.  I can't figure out how to work around this
  21. problem.  Defining the function in the definition would work only for
  22. very limited functions (non-recursive etc.).
  23.  
  24. // Compiled with: g++ nested-classes.cc
  25. // Compiler: gcc 2.3.1
  26. // sparc-sun-sunos4.1
  27. // SPARCstation 2 running 4.1.1
  28. //
  29. // Example drawn from page 187 ARM
  30. class enclose {
  31.   class inner {
  32.    public:
  33.     ~inner();
  34.   };
  35. };
  36.  
  37. // Causes cc1plus to get fatal signal 11 - segmentation violation
  38. enclose::inner::~inner()
  39. {
  40.   x = 0;
  41. }
  42.  
  43.