This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: throw specs on Standard destructors
Nathan Myers <ncm-nospam@cantrip.org> writes:
| On Wed, Dec 11, 2002 at 10:05:17AM -0600, Benjamin Kosnik wrote:
| >
| > >>> Third, any code that depends on tight throw specs in libstdc++
| > >>> would not be portable to other implementations.
| >
| > >Any code that depends on tight throw specs of Standard-conformant
| > >implementations would not be portable to GCC.
| >
| > ... which is far more of an issue, I think.
|
| No. An implementation is not required to declare destructors throw().
| Any code that fails if they're not so declared is broken, because it
| assumes an implementation detail that the standard doesn't specify.
|
| It's the worst kind of broken: testing fails to detect the error
| until the code is moved. We're doing him an enormous favor by
| refusing to compile his code. Wherever he's moving it from failed
| to do him that favor.
|
| As I noted earlier, if we do add any "throw()" specs, for performance
| reasons, we should wrap them in "#ifndef NDEBUG" so that we can continue
| to provide the service of reporting this error.
I think Nathan says nicely what I would have probably phrased poorly.
Sorry for a "me too" message, but what Nathan expresses just happens
to match my reading.
-- Gaby