https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115522
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #3) > static_assert(is_constructible_v<_Tp, _Tp&>); > if constexpr (is_constructible_v<_Tp, _Tp&>) > { > - if constexpr (is_trivial_v<_Tp>) > + if constexpr (is_trivial_v<_Tp> && is_default_constructible_v<_Tp> > + && is_copy_assignable_v<_Tp>) For the testcase above, it would be sufficient to do: if constexpr (is_trivial_v<_Tp> && is_copy_assignable_v<_Tp>) The type with const members isn't assignable. I'm not sure if this covers all cases. I think combined with is_trivial it should do, but then I don't understand why the struct ranges type is trivial in the first place.