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

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Wolfgang Roehrl from comment #3)
> The compiler rejects this program too - is this correct?

Yes. Adding constexpr to the constructor only means that it *can* be used in
constant-expressions, not that it is always a constant-expression, so in the
general case 'b' is still a run-time variable not a constant.

Just use m_counter( b ? 1u : 0u ) or m_counter{ short(b ? 1u : 0u) }

Reply via email to