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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
N.B. the finalize<int_range<1>> function is correct. The Clang warning is
saying "this class is not final, so the dynamic type might be different from
the static type" (in which case we would have UB) but that is not actually the
case here. It's correct by construction, because the finalize function is
instantiated for the type being allocated, so the static type matches the
dynamic type.

By making value_range_equiv final, we enforce that the static type is the same
as the dynamic type, by forbidding derivation from that type.

Reply via email to