extern const char *const MemoryError;
extern const char *const UnixAPI;
extern const char *const CXXObjectLifecycle;
+extern const char *const CXXMoveSemantics;
extern const char *const SecurityError;
} // namespace categories
} // namespace ento
};
private:
- mutable std::unique_ptr<BugType> BT;
+ BugType BT{this, "Use-after-move", categories::CXXMoveSemantics};
// Check if the given form of potential misuse of a given object
// should be reported. If so, get it reported. The callback from which
MisuseKind MK) const {
if (ExplodedNode *N = misuseCausesCrash(MK) ? C.generateErrorNode()
: C.generateNonFatalErrorNode()) {
-
- if (!BT)
- BT.reset(new BugType(this, "Use-after-move",
- "C++ move semantics"));
-
// Uniqueing report to the same object.
PathDiagnosticLocation LocUsedForUniqueing;
const ExplodedNode *MoveNode = getMoveLocation(N, Region, C);
}
auto R = std::make_unique<PathSensitiveBugReport>(
- *BT, OS.str(), N, LocUsedForUniqueing,
+ BT, OS.str(), N, LocUsedForUniqueing,
MoveNode->getLocationContext()->getDecl());
R->addVisitor(std::make_unique<MovedBugVisitor>(*this, Region, RD, MK));
C.emitReport(std::move(R));
const char *const MemoryError = "Memory error";
const char *const UnixAPI = "Unix API";
const char *const CXXObjectLifecycle = "C++ object lifecycle";
+const char *const CXXMoveSemantics = "C++ move semantics";
const char *const SecurityError = "Security error";
} // namespace categories
} // namespace ento