comparison gcc/testsuite/g++.dg/expr/pmf-3.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
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 ), "" );