https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115858 --- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This code becomes invalid after https://wg21.link/CWG1670 . But you can fix up the conversion operator.