[PATCH] D43798: [analyzer] UndefinedAssignment: Fix warning message on implicit copy/move constructors.

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 27 13:32:39 PST 2018


NoQ added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp:60
   // Generate a report for this bug.
+  std::string Str;
+  llvm::raw_string_ostream OS(Str);
----------------
a.sidorin wrote:
> SmallString<128>?
*recalls how it's done* Ok!


================
Comment at: lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp:98
+          if (I->getInit()->IgnoreImpCasts() == StoreE) {
+            OS << "Value assigned to field '" << I->getMember()->getName()
+               << "' is garbage or undefined";
----------------
a.sidorin wrote:
> May be it is better to print qualified name? Just name of member can be misleading if base classes have members with same names.
I don't think this can happen in an implicit constructor. We'd jump to the base-class constructor in this case.


https://reviews.llvm.org/D43798





More information about the cfe-commits mailing list