gcc/testsuite/g++.dg/DRs/dr1423.C
raw| 1 | // DR 1423 - Convertibility of nullptr to bool. |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | bool b = nullptr; // { dg-error "converting to .bool. from .std::nullptr_t. requires direct-initialization" } |
| 5 | bool b2(nullptr); |
| 6 | bool b3{nullptr}; |
| 7 | bool b4 = { nullptr }; // { dg-error "converting to .bool. from .std::nullptr_t. requires direct-initialization" } |