https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71069
Bug ID: 71069 Summary: Extend -Wnonnull-compare to address of reference Product: gcc Version: 6.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eugene.zelenko at gmail dot com Target Milestone: --- I had crash in optimized build because pointer check is skipped in next situation (null pointer is sneaked into container): void setData( Data &data ) { _current_data = &data; if ( _current_data ) _set_data.insert( _current_data ); } I think will be good idea to report such situations in -Wnonnull-compare.