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