On 4/11/19 5:36 PM, Marek Polacek wrote:
This patch deals with constexpr functions and whether or not they should be
noexcept.
CWG 1129 specified that constexpr functions are noexcept: it was a special case
in [expr.unary.noexcept]. This was accidentally removed in <wg21.link/p0003>
but the CWG conclusion was to keep it as-is.
Clearly we need to change this for C++17. The question is whether we should
treat it as a DR and apply it retroactively (which is what clang did). I took
the same approach and my reasoning is in the comment in check_noexcept_r.
Arguably it might be too late to put this in now, maybe we should defer to GCC
10.
But at least there's a patch.
Bootstrapped/regtested on x86_64-linux.
2019-04-11 Marek Polacek <pola...@redhat.com>
PR c++/87603 - constexpr functions are no longer noexcept.
* constexpr.c (is_sub_constant_expr): Remove unused function.
* cp-tree.h (is_sub_constant_expr): Remove declaration.
* except.c (check_noexcept_r): Don't consider a call to a constexpr
function noexcept.
OK. This is actually one of the issues that I ran into with cmcstl2, so
let's go ahead and put it in now.
Jason