Debian Codegraph @

gcc/testsuite/g++.dg/expr/pmf-3.C

raw
1 // PR c++/80485
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-fdelete-null-pointer-checks" }
4
5 struct dummy {
6 void nonnull() {};
7 void nonnull2();
8 };
9
10 typedef void (dummy::*safe_bool)();
11
12 constexpr safe_bool a = &dummy::nonnull;
13 constexpr safe_bool b = &dummy::nonnull2;
14
15 static_assert( static_cast<bool>( a ), "" );
16 static_assert( static_cast<bool>( b ), "" );