https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101438
--- Comment #4 from Andrey Vihrov <andrey.vihrov at gmail dot com> --- Looks like this is a duplicate of bug 105032 (or vice versa). Both samples from this bug succeed for me with GCC 11.3 and GCC 12.