[PATCH] D36715: [clang] minor cleanup in clang/tooling/refactoring

Alexander Shaposhnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 14 14:43:40 PDT 2017


alexshap created this revision.

1. Add missing explicit.
2. Add missing std::move

(return type is Expected<std::vector<AtomicChange>> but we return std::vector<AtomicChange>, so cast to && is necessary).

Test plan: make check-all


Repository:
  rL LLVM

https://reviews.llvm.org/D36715

Files:
  include/clang/Tooling/Refactoring/Rename/SymbolName.h
  lib/Tooling/Refactoring/Rename/RenamingAction.cpp


Index: lib/Tooling/Refactoring/Rename/RenamingAction.cpp
===================================================================
--- lib/Tooling/Refactoring/Rename/RenamingAction.cpp
+++ lib/Tooling/Refactoring/Rename/RenamingAction.cpp
@@ -53,7 +53,7 @@
     }
     Changes.push_back(std::move(Change));
   }
-  return Changes;
+  return std::move(Changes);
 }
 
 /// Takes each atomic change and inserts its replacements into the set of
Index: include/clang/Tooling/Refactoring/Rename/SymbolName.h
===================================================================
--- include/clang/Tooling/Refactoring/Rename/SymbolName.h
+++ include/clang/Tooling/Refactoring/Rename/SymbolName.h
@@ -29,7 +29,7 @@
 /// \endcode
 class SymbolName {
 public:
-  SymbolName(StringRef Name) {
+  explicit SymbolName(StringRef Name) {
     // While empty symbol names are valid (Objective-C selectors can have empty
     // name pieces), occurrences Objective-C selectors are created using an
     // array of strings instead of just one string.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36715.111078.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170814/e7d2bc7a/attachment-0001.bin>


More information about the cfe-commits mailing list