This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add cppcoreguidelines-declare-not-null
AbandonedPublicDraft

Authored by fedeBuonco on Aug 18 2022, 6:08 AM.

Details

Reviewers
None
Summary

Adds a check for C++ Core Guidelines "I.12: Declare a pointer that must not be null as not_null"
Produces a warning on pointers passed as parameters that are checked against nullptr before access, on all control-flow paths.

Diff Detail

Event Timeline

fedeBuonco created this revision.Aug 18 2022, 6:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2022, 6:08 AM
fedeBuonco retitled this revision from Initial commit for cppcoreguidelines-declare-not-null to [clang-tidy] Initial commit for cppcoreguidelines-declare-not-null.Aug 18 2022, 6:11 AM
fedeBuonco retitled this revision from [clang-tidy] Initial commit for cppcoreguidelines-declare-not-null to [clang-tidy] Add cppcoreguidelines-declare-not-null.Aug 18 2022, 6:33 AM
fedeBuonco edited the summary of this revision. (Show Details)

Add simple test case

fedeBuonco abandoned this revision.Sep 7 2022, 7:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2022, 7:44 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript