aaron.ballman added inline comments.
================
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:467
+StringRef getName(const NamedDecl *ND) {
+ if (!ND->getIdentifier())
+ return StringRef();
----------------
This logic could be improved as:
```
if (const auto *ID = ND->getIdentifier())
return ID->getName();
return "";
```
However, I'm not certain that this function is needed at all -- it's pretty
simple and is only used from `isStandardSmartPointer()`.
================
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:482
+ StringRef Name = getName(RecordDecl);
+ if (Name != "unique_ptr" && Name != "shared_ptr")
+ return false;
----------------
Shouldn't this improvement also include `weak_ptr`?
================
Comment at: clang-tidy/misc/UseAfterMoveCheck.cpp:542
+ auto StandardSmartPointerTypeMatcher = hasType(
+ cxxRecordDecl(hasAnyName("::std::unique_ptr", "::std::shared_ptr")));
+
----------------
And `::std::weak_ptr`?
Repository:
rL LLVM
https://reviews.llvm.org/D26041
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits