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

--- Comment #3 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
I think according to https://eel.is/c++draft/basic.stc#general-4 the function
shall return an "invalid pointer valued". And nullptr is not considered such.

And if one modifies the function slightly (see auto p appear):

constexpr auto g() {
    int i = 0;
    auto p = &i;
    return p;
};

Then static_assert passes: https://gcc.godbolt.org/z/5shcxfcxG

Reply via email to