From 1757970370475363811
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,96a8c01f7043c2d9
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-09-27 09:42:56 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: francis.glassborow@ntlworld.com (Francis Glassborow)
Newsgroups: comp.std.c++
Subject: Re: Proposal: exception stack unwinding resumption
Date: Fri, 27 Sep 2002 16:42:55 +0000 (UTC)
Organization: Southfield Microcomputer SS
Lines: 91
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <AX7FhYba+Fl9Ew0t@robinton.demon.co.uk>
References: <6df0c6a8.0208260746.633710cb@posting.google.com>
 <23b84d65.0209161107.23bea618@posting.google.com>
 <6df0c6a8.0209170602.2cb54634@posting.google.com>
 <RW_h9.899$nU2.53545@newsfep1-gui.server.ntli.net>
 <6df0c6a8.0209201925.6faa9e57@posting.google.com>
 <c87c1cfb.0209220939.46d823af@posting.google.com>
 <6df0c6a8.0209230602.2aba3ca8@posting.google.com>
 <c87c1cfb.0209231924.6b639ab2@posting.google.com>
 <6df0c6a8.0209240716.6fb5ec00@posting.google.com>
 <c87c1cfb.0209252107.70dc6f8e@posting.google.com>
 <ZRjjgCB9B1k9Ewft@robinton.demon.co.uk>
 <gGVk9.2334$sh4.110044@newsfep2-win.server.ntli.net>
Mime-Version: 1.0
Content-Type: text/plain;charset=us-ascii;format=flowed
X-Trace: mail2news.demon.co.uk 1033144975 5962 10.0.0.1 (27 Sep 2002 16:42:55 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Fri, 27 Sep 2002 16:42:55 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 17uyCc-0001Y1-00
	for mail2news@news.news.demon.net; Fri, 27 Sep 2002 16:42:54 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id CAA16438; Sat, 28 Sep 2002 02:42:17 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-Reply-To: Francis Glassborow <francisG@robinton.demon.co.uk>
X-Newsgroups: comp.std.c++
X-User-Agent: Turnpike/6.01-U (<TilyaeicE$WmMOP9F8P4$y3lmP>)
Xref: archiver1.google.com comp.std.c++:14277

In article <gGVk9.2334$sh4.110044@newsfep2-win.server.ntli.net>, Garry 
Lancaster <glancaster@ntlworld.com> writes
>#include <iostream>
>#include <string>
>#include <exception>
>
>class B
>{
>public:
> ~B()
>    {
>     std::cout << "~B\n";
>        if( std::uncaught_exception() ) std::cout << "Unwinding.\n";
>        throw std::string( "~B" );
>    }
>};
>
>class A : public B
>{
>public:
> ~A()
>
>
>  std::cout << "~A\n";
>  throw std::string( "~A" );
> }
>};
>
>int main()
>{
> try
> {
>  A a;
>    }
>    catch(const std::string s)
>    {
>     std::cout << "Caught exception thrown by " << s << ".\n";
>    }
>    std::cout << "Exiting normally.\n";
>}
>
>If I understand Bob Bell's reasoning correctly, he is saying that
>the program should print:
>
>~A
>Caught exception thrown by ~A.
>Exiting normally.
>
>I wonder if CodeWarrior 7 would agree?
>
>MSVC7 gives:
>
>~A
>~B
>Unwinding.
>
>then terminates.
>
>and Borland C++ Builder 5 gives:
>
>~A
>~B
>
>then terminates.

And if I have followed that code correctly (allowing for typos)

I believe that it should produce:

~A
~B
Unwinding
Caught exception thrown by ~A
exiting normally

And I think that is the only meaningful interpretation of the sentences 
I quoted.


-- 
Francis Glassborow      ACCU
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



