https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97230
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2020-09-28 Ever confirmed|0 |1 Keywords|compile-time-hog |accepts-invalid --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- GCC trunk does warn about exactly the issue: ce.cc: In function 'int main()': ce.cc:10:43: warning: 'this' pointer null [-Wnonnull] 10 | constexpr auto x = ((X*)nullptr)->foo(); | ^ ce.cc:4:19: note: in a call to non-static member function 'constexpr int X::foo() const' 4 | constexpr int foo(){ | ^~~ But that should be an error during constant evaluation.