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

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 12 12:23:29 PDT 2018


NoQ accepted this revision.
NoQ added a comment.

Looks good!



================
Comment at: lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp:691
 
+StringRef getVariableName(const FieldDecl *Field) {
+  // If \p Field is a captured lambda variable, Field->getName() will return
----------------
Szelethus wrote:
> george.karpenkov wrote:
> > Is this a member method? Then it should be prefixed with a class name.
> > Currently it looks like you have a member method without an implementation and a separate C-style function?
> It is a statically defined method, and you can see its forward declaration in the same diff.
> 
> Back when I started writing this checker, the amount of function laying in the anonymous namespace was very few, but this has changed. I'll fix it sometime because it's getting somewhat annoying (and is against the [[ https://llvm.org/docs/CodingStandards.html | coding standards ]]).
Yeah, just make them `static`, it's easier to read (https://llvm.org/docs/CodingStandards.html#anonymous-namespaces).


https://reviews.llvm.org/D48291





More information about the cfe-commits mailing list