This is an archive of the discontinued LLVM Phabricator instance.

adds -Wfree-nonheap-object member var checks
ClosedPublic

Authored by cjdb on Oct 27 2020, 2:59 PM.

Details

Summary

Checks to make sure that stdlib's (std::)free is being appropriately
used for member variables.

Diff Detail

Event Timeline

cjdb requested review of this revision.Oct 27 2020, 2:59 PM
cjdb created this revision.
aaron.ballman added inline comments.Oct 28 2020, 6:20 AM
clang/lib/Sema/SemaChecking.cpp
10110–10112

const std::string&?

10123

const std::string&?

clang/test/Sema/warn-free-nonheap-object.cpp
17

Can you also verify that ::free(ptr) does not diagnose? (since that would require CFG)

cjdb updated this revision to Diff 301451.Oct 28 2020, 3:00 PM
cjdb marked 3 inline comments as done.
This revision is now accepted and ready to land.Oct 29 2020, 2:13 PM
This revision was automatically updated to reflect the committed changes.