[PATCH] D48291: [analyzer][UninitializedObjectChecker] Fixed captured lambda variable name

George Karpenkov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 19 11:33:11 PDT 2018


george.karpenkov added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:685
+
+  if (CXXParent && CXXParent->isLambda()) {
+    CXXRecordDecl::capture_const_iterator CapturedVar =
----------------
Szelethus wrote:
> george.karpenkov wrote:
> > CXXParent is guaranteed to be non-null at this stage, otherwise dyn_cast fails
> I found this on http://llvm.org/docs/ProgrammersManual.html#the-isa-cast-and-dyn-cast-templates:
> 
> >dyn_cast<>:
> >
> >    The dyn_cast<> operator is a “checking cast” operation. It checks to see if the operand is of the specified type, and if so, returns a pointer to it (this operator does not work with references). If the operand is not of the correct type, a null pointer is returned.
> 
> So I guess this should be alright.
Oops sorry my bad.


Repository:
  rC Clang

https://reviews.llvm.org/D48291





More information about the cfe-commits mailing list