In ["What breaks without implicit `T*`-to-`bool` conversion?"](/blog/2025/10/05/pointer-to-bool-conversion/) (2025-10-05) I wrote that in a proprietary C++17 codebase my audit turned up "one non-`explicit` `operator bool`, and zero bugs." On closer inspection we found that that non-explicit `operator bool` actually was causing a real bug! Consider this hypothetical type that behaves something like `unique_ptr` ([Godbolt](https://godbolt.org/z/EMc96648a)): struct IntPtr { explicit IntPtr() = d...| Arthur O’Dwyer
C++20 took a small step by deciding (via P1957) that a T*-to-bool conversion should be considered narrowing, and thus forbidden in list-initialization. But could we go further and make T*-to-bool conversion non-implicit? I patched my local copy of Clang to forbid implicit conversion from T* to bool. Here’s all the things that broke when I compiled LLVM/Clang itself with my patched compiler.| Arthur O’Dwyer