https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66197 --- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> --- Indeed, this is also fixed in mainline. I'm adding a testcase and closing the bug.