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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-09-20
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed, here is a testcase which does not require C++20 (though it does use
a GNU extension):

struct X {
  constexpr int f() { return 0; }
};
constexpr int g() {
    return (X*){nullptr}->f();
}

int t = g();
---- CUT ----
here is one which is invalid C++14 (and does not use the GNU extension):
struct X {
  constexpr int f() { return 0; }
};
constexpr int g() {
    X *x = nullptr;
    return x->f();
}

int t = g();
-------- CUT ------
I only noticed that clang rejects it while ICC and MSVC accept it also.

Reply via email to