Initializing a reference by dereferenced null pointer is not diagnosed but should be because such a reference is invalid: $ cat t.C && gcc -O2 -S -Wall -Wextra -Wnull-dereference -fdump-tree-optimized=/dev/stdout t.C void f (const int&); void g () { int *p = 0; f (*p); } ;; Function g (_Z1gv, funcdef_no=0, decl_uid=2330, cgraph_uid=1, symbol_order=0) g () { <bb 2> [local count: 1073741824]: f (0B); [tail call] return; } Clang doesn't diagnose it either unless --analyze is used: $ clang -S -Wall -Wextra --analyze t.C t.C:5:3: warning: Forming reference to null pointer f (*p); ^~~~~~ 1 warning generated.
I was about to classify this as an enhancement but after reading the description of -Wnull-dereference in the manual ("compiler detects paths that trigger erroneous or undefined behavior due to dereferencing a null pointer") I'm inclined to view it as a bug. The code is clearly in error, GCC just doesn't detect it (even though the "doesn't detect it" part could be used to argue the warning works strictly as documented).
Confirmed.