This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: throw specs on Standard destructors


On Tue, Dec 10, 2002 at 02:53:02PM -0600, Benjamin Kosnik wrote:
> >First, in any function so declared that itself called a function 
> >which might throw something not listed, the compiler would have to 
> >generate code to catch them and call terminate().  
> >
> >Second, if it later became necessary to allow such a function
> >to throw an exception not listed, any code that depended on its 
> >previous spec would be broken.
> >
> >Third, any code that depends on tight throw specs in libstdc++
> >would not be portable to other implementations.
> 
> Sorry. I was talking just about destructors, which I believe is clearly
> implied in the standard. (see references to standard in first post).

I think the first and third points still hold.   The first makes
writing the patch less straightforward than it might seem.  The
third implies that any throw specs we do add (aside from extern "C"
declarations) might best be guarded by "#ifdef NDEBUG" so that users 
like the original poster will not be fooled.

Nathan Myers
ncm-nospam@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]