This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 26099 (first part)
Paolo Carlini wrote:
>>> + if (t && !TREE_NOTHROW (t))
>>>
>> I think you need to check the exception declaration on the type, not
>> TREE_NOTHROW. TREE_NOTHROW may be set by the optimizers when a function
>> can be proven not to throw, but I assume the standard is talking about
>> the declared exception specification?
>>
> This is interesting. In fact, the most recent specifications, per N2157,
> don't talk at all about exception specifications, but only about "... is
> known not to throw an exception..." (at some point, in TR1, it was empty
> exception specifications OR can otherwise be deduced never to throw an
> exception). Therefore, I think the code is OK.
That is interesting indeed. I would argue that such words should never
make it into the standard; something like the TR1 wording seems much
better, as it does set a floor on which users can rely. "is known not
to" is not something that users can rely on at all; a dumb compiler
might not know anything. :-)
The revised patch is OK, with Doug's additional suggestions.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713