[Bug c++/95564] GCC rejects lambda expression with "noexcept(1+1)"

de34 at live dot cn gcc-bugzilla@gcc.gnu.org
Thu Dec 16 10:17:19 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95564

Jiang An <de34 at live dot cn> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |de34 at live dot cn

--- Comment #3 from Jiang An <de34 at live dot cn> ---
(In reply to Andrew Pinski from comment #2)
> GCC is inconsitent here. with static_assert and constexpr GCC accepts it (PR
> 87724) while rejects it for noexcept.

Currently narrowing conversions are still forbidden in noexcept and explicit
specifiers.

The inconsistency is acknowledged in C++23 (WG21-P1401R5), but it seems that
P1401 is not a DR, as the related CWG 2320 is closed as extension. I don't know
whether we should reject narrowing conversions in static_assert/if constexpr in
earlier modes.


More information about the Gcc-bugs mailing list