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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Btw, clang behaves the same:

> clang++ t.C -O2
t.C:4:12: warning: reference cannot be bound to dereferenced null pointer in
      well-defined C++ code; pointer may be assumed to always convert to true
      [-Wundefined-bool-conversion]
      if (&iref)
      ~~   ^~~~
1 warning generated.
rguenther@e111:/tmp> ./a.out 
Segmentation fault (core dumped)

and it doesn't diagnose *NULL either.

Reply via email to