https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111388
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Adding: ``` if (ab.index()>=2) __builtin_unreachable(); ``` to operator-> Also fixes the issue. C++23 would be: [[assume(ab.index()<2)]]; (Except that does not optimize currently).