4 ms·
> it should be flagged or not compiled. It will be, if you use clang-tidy (or clang's static analyzer): $ clang-tidy main.cpp -- -std=c++14 1 warning
by jhasse 9y ago
> it should be flagged or not compiled.
It will be, if you use clang-tidy (or clang's static analyzer):
$ clang-tidy main.cpp -- -std=c++14
1 warning generated.
main.cpp:10:5: warning: Forming reference to null pointer [clang-analyzer-core.NonNullParamChecker]
f_unused_parameter(*i);
^
main.cpp:19:7: note: Passing null pointer value via 1st parameter 'i'
f(nullptr);
^
main.cpp:19:5: note: Calling 'f'
f(nullptr);
^
main.cpp:10:5: note: Forming reference to null pointer
f_unused_parameter(*i);
^