https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109277
Patrick Palka <ppalka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs-bisection, | |needs-reduction | --- Comment #10 from Patrick Palka <ppalka at gcc dot gnu.org> --- Thus started with the move to use the built-in __is_convertible in std::is_convertible, r13-2883-gaf85ad891703db (In reply to Patrick Palka from comment #9) > One fix is to define a move constructor for TNode, which causes GCC's > perfect candidate optimization (r11-7287-g187d0d5871b1fa) to kick in and > avoid considering the template candidate #1. Another fix is to use > std::conjunction/disjunction in is_subtype so that the condition properly > short-circuits (is_base_of<T, T> is true even for incomplete T). Note that the first proposed fix would just paper over the UB, whereas the second fix would eliminate it IIUC.