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

--- Comment #8 from Fedor Chelnokov <fchelnokov at gmail dot com> ---
Please note that GCC 13 also accepts invalid program (because dangling pointers
were converted in nullptr):

constexpr auto f(int a) {
    return &a;
}

constexpr auto g(int b) {
    return &b;
}

static_assert(f(1) <= g(2));

This program must be rejected because of relational comparison of unrelated
pointers as Clang and MSVC do, online demo: https://gcc.godbolt.org/z/q5z3Gvehe
And your patch fixes it as well, thanks.

Reply via email to