https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95832

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
No, that doesn't work for things convertible to pointers.

#include <variant>
struct P { operator void*() const; };
std::variant<bool> v{ P{} };

The argument type here is not a pointer, so your suggestion would construct the
bool, which is exactly the case P0602 was designed to prevent.

"Can be converted to bool via conversion to a pointer or function pointer type"
is not practical to detect, and I have no intention of trying. See Bug 93628
for a related problem.

Reply via email to