home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.g++.bug
- 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
- From: teague@stc.lockheed.COM (Alan Teague)
- Subject: Nested Classes Problem
- Message-ID: <9211170255.AA08964@stc.lockheed.com>
- Sender: gnulists@ai.mit.edu
- Organization: GNUs Not Usenet
- Distribution: gnu
- Date: Tue, 17 Nov 1992 02:55:00 GMT
- Approved: bug-g++@prep.ai.mit.edu
- Lines: 30
-
- The following code causes the compile to crash. If it doesn't cause your
- compiler to crash also, then please let me know so that I can check the
- installation and building of the one here.
-
- Under g++ 1.40.3 this code generates the error message:
- multiple `::' terms in declarator invalid
- But I could work around it by dropping the "enclose::" part of the
- destructor definition. I can't figure out how to work around this
- problem. Defining the function in the definition would work only for
- very limited functions (non-recursive etc.).
-
- // Compiled with: g++ nested-classes.cc
- // Compiler: gcc 2.3.1
- // sparc-sun-sunos4.1
- // SPARCstation 2 running 4.1.1
- //
- // Example drawn from page 187 ARM
- class enclose {
- class inner {
- public:
- ~inner();
- };
- };
-
- // Causes cc1plus to get fatal signal 11 - segmentation violation
- enclose::inner::~inner()
- {
- x = 0;
- }
-
-