[PATCH] D38810: [Analyzer] Support bodyfarming std::call_once for libstdc++
Devin Coughlin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 11 11:24:20 PDT 2017
dcoughlin accepted this revision.
dcoughlin added a comment.
This revision is now accepted and ready to land.
LGTM with the dyn_cast mentioned inline changed.
Comment at: lib/Analysis/BodyFarm.cpp:359
+ ValueDecl *FieldDecl = dyn_cast<ValueDecl>(FoundDecl);
bool isLambdaCall = CallbackType->getAsCXXRecordDecl() &&
Should this be a cast<>() rather than a dyn_cast<>()? Do you expect this to fail? If so then you should check the result for null. If not then the idiom is to use cast<>().
An alternative would be to change findMemberField() to return a FieldDecl.
More information about the cfe-commits