Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-memfn2.C

raw
1 // PR c++/102420
2 // { dg-do compile { target c++11 } }
3
4 struct X {
5 constexpr int f() { return 0; }
6 };
7 constexpr int g(X* x) {
8 return x->f(); // { dg-error "dereferencing a null pointer" }
9 }
10 constexpr int t = g(nullptr); // { dg-message "in .constexpr. expansion" }