[PATCH] D22208: clang-tidy] Fixes to modernize-use-emplace
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 11 11:12:06 PDT 2016
aaron.ballman added inline comments.
================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:21
@@ +20,3 @@
+llvm::Optional<ast_matchers::internal::Matcher<NamedDecl>>
+getHasAnyName(const std::vector<std::string> &names) {
+ llvm::Optional<ast_matchers::internal::Matcher<NamedDecl>> hasMatcher;
----------------
Should be `Names` instead.
================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:21
@@ +20,3 @@
+llvm::Optional<ast_matchers::internal::Matcher<NamedDecl>>
+getHasAnyName(const std::vector<std::string> &names) {
+ llvm::Optional<ast_matchers::internal::Matcher<NamedDecl>> hasMatcher;
----------------
aaron.ballman wrote:
> Should be `Names` instead.
Is this needed? We have the `hasAnyName()` matcher already.
================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:31-33
@@ +30,5 @@
+
+const std::string defaultContainersWithPushBack =
+ "std::vector; std::list; std::deque";
+const std::string defaultSmartPointers =
+ "std::shared_ptr; std::unique_ptr; std::auto_ptr; std::weak_ptr";
----------------
These should start with a capital as well (coding standard information pertaining to names can be found at http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly).
================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:32-34
@@ +31,5 @@
+const std::string defaultContainersWithPushBack =
+ "std::vector; std::list; std::deque";
+const std::string defaultSmartPointers =
+ "std::shared_ptr; std::unique_ptr; std::auto_ptr; std::weak_ptr";
+} // namespace
----------------
These should be using `::std::` instead of `std::` just in case people do awful things like embed `namespace std` inside of their own namespaces.
================
Comment at: clang-tidy/modernize/UseEmplaceCheck.h:36
@@ -32,1 +35,3 @@
+private:
+ std::vector<std::string> containersWithPushBack, smartPointers;
};
----------------
Should be Containers and Smart (capital letters).
Repository:
rL LLVM
http://reviews.llvm.org/D22208
More information about the cfe-commits
mailing list