[PATCH] C++11: noexcept should check whether the expression is a constant expression
Richard Smith
richard at metafoo.co.uk
Mon Mar 25 17:03:30 PDT 2013
On Mon, Mar 25, 2013 at 4:21 PM, Ismail Pazarbasi <
ismail.pazarbasi at gmail.com> wrote:
>
> I have read the resolution for the issue 1351, and I was curious about
> aligning this with the removal of dynamic exception specifications as well.
I've started working on implementing core issue 1351. We discussed this
issue in a CWG teleconference today, and there are some tweaks to the
wording coming...
Could you please confirm whether I understood this part correctly; given
> the example in issue 1351, in the move constructor declaration, "noexcept"
> is represented with an empty set:
> `B(B&&, int = (throw Y(), 0)) throw(Y) noexcept;`
>
This is ill-formed. A function declaration can only have one
exception-specification.
> The union of set of potential exceptions is: {Y} U {Y} U {} = {Y};
> Likewise, if it was:
> `B(B&&, int = (throw Y(), 0)) throw(Z) noexcept;`
> The union of set of potential exceptions: {Y} U {Z} U {} = {Y, Z}
>
> Could you please explain the purpose of having throw(E) and noexcept on
> the same declarator? I understand throw(E) and noexcept(false) would be
> compatible.
throw(E) and noexcept(false) are not compatible exception-specifications;
see 15.4/3.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130325/f0456941/attachment.html>
More information about the cfe-commits
mailing list