[Bug c++/104823] [12 Regression] narrowing conversion inside non-dependent decltype operand silently accepted ever since r12-6075

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 7 17:36:06 GMT 2022


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

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
r12-6075 is exposing a latent bug with non-dependent decltype folding, namely
we instantiate the expression only if it's potentially constant.  In this case,
id(v) is not potentially constant because id is not a constexpr function, so we
discard the expression without actually instantiating it and therefore never
issue the narrowing warning.


More information about the Gcc-bugs mailing list