[Bug c++/94554] spurious -Waddress warning within "if constexpr" function-null compares
jason at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jun 23 04:31:39 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94554
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Daniel Krügler from comment #3)
> The example is ill-formed because the condition of 'if constexpr' is more
> restricted than that of normal 'if': It expects "a contextually converted
> constant expression of type bool" and [expr.const] p10 lists the allowed
> conversions in this case. This list omits the boolean conversions
> ([conv.bool]).
This was changed by wg21.link/p1401 so the conversion is allowed in this
context as well.
More information about the Gcc-bugs
mailing list