[Bug c++/102286] [constexpr] construct_at incorrectly starts union array lifetime in some cases

ldalessandro at gmail dot com gcc-bugzilla@gcc.gnu.org
Sat Sep 11 02:49:44 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102286

--- Comment #2 from Luke Dalessandro <ldalessandro at gmail dot com> ---
Okay, one last simplification for posterity.

    constexpr void bar() {
        union {
            int data[1];
        } u;
        std::construct_at(u.data, 0);
    }

https://godbolt.org/z/r4M3voh6W


More information about the Gcc-bugs mailing list