[PATCH] D57435: [clang-tidy] Add abseil-wrap-unique check

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 30 11:06:25 PST 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tidy/abseil/AbseilTidyModule.cpp:61
+        "abseil-wrap-unique");
+ 
+ }
----------------
Unnecessary empty line.


================
Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:10
+
+#include <string>
+#include "WrapUniqueCheck.h"
----------------
Please run Clang-format.


================
Comment at: clang-tidy/abseil/WrapUniqueCheck.cpp:75
+  if(cons){
+   
+    if (cons->isListInitialization()){
----------------
Unnecessary empty line.


================
Comment at: docs/ReleaseNotes.rst:70
 
+- New :doc:`abseil-wrap-unique
+  <clang-tidy/checks/abseil-wrap-unique>` check.
----------------
Please use alphabetical order in new checks list.


================
Comment at: docs/ReleaseNotes.rst:74
+  Looks for instances of factory functions which uses a non-public constructor
+  that returns a std::unqiue_ptr<T> then recommends using 
+  absl::wrap_unique(new T(...)).
----------------
Please use `` to highlight language constructs. Same in documentation.


================
Comment at: docs/clang-tidy/checks/abseil-wrap-unique.rst:6
+
+Checks for instances of static function within a class being called and
+returning a std:unique_ptr<T> type. Also checks for instances where reset
----------------
Please synchronize first statement with Release Notes.


================
Comment at: docs/clang-tidy/checks/abseil-wrap-unique.rst:24
+ 
+  //Original - reset called with a static function returning a std::unqiue_ptr
+  a.reset(A::NewA());
----------------
Please run Clang-format over code snippets.


================
Comment at: test/clang-tidy/abseil-wrap-unique.cpp:3
+
+
+namespace std {
----------------
Unnecessary empty line.


================
Comment at: test/clang-tidy/abseil-wrap-unique.cpp:31
+}  // namespace std
+
+
----------------
Unnecessary empty line.


================
Comment at: test/clang-tidy/abseil-wrap-unique.cpp:88
+  //std::unique_ptr<int> e(new int[2] {1,2});
+  
+}
----------------
Unnecessary empty line.


================
Comment at: test/clang-tidy/abseil-wrap-unique.cpp:90
+}
+
+
----------------
Unnecessary empty lines.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57435/new/

https://reviews.llvm.org/D57435





More information about the cfe-commits mailing list