[libcxx-commits] [PATCH] D127896: [libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used checks

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 15 12:29:14 PDT 2022


philnik created this revision.
Herald added a subscriber: xazax.hun.
Herald added a project: All.
philnik requested review of this revision.
Herald added subscribers: libcxx-commits, aheejin.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127896

Files:
  libcxx/.clang-tidy
  libcxx/include/strstream


Index: libcxx/include/strstream
===================================================================
--- libcxx/include/strstream
+++ libcxx/include/strstream
@@ -266,8 +266,8 @@
     _LIBCPP_INLINE_VISIBILITY
     istrstream& operator=(istrstream&& __rhs)
     {
-        istream::operator=(_VSTD::move(__rhs));
         __sb_ = _VSTD::move(__rhs.__sb_);
+        istream::operator=(_VSTD::move(__rhs));
         return *this;
     }
 #endif // _LIBCPP_CXX03_LANG
@@ -315,8 +315,8 @@
     _LIBCPP_INLINE_VISIBILITY
     ostrstream& operator=(ostrstream&& __rhs)
     {
-        ostream::operator=(_VSTD::move(__rhs));
         __sb_ = _VSTD::move(__rhs.__sb_);
+        ostream::operator=(_VSTD::move(__rhs));
         return *this;
     }
 #endif // _LIBCPP_CXX03_LANG
@@ -375,8 +375,8 @@
     _LIBCPP_INLINE_VISIBILITY
     strstream& operator=(strstream&& __rhs)
     {
-        iostream::operator=(_VSTD::move(__rhs));
         __sb_ = _VSTD::move(__rhs.__sb_);
+        iostream::operator=(_VSTD::move(__rhs));
         return *this;
     }
 #endif // _LIBCPP_CXX03_LANG
Index: libcxx/.clang-tidy
===================================================================
--- libcxx/.clang-tidy
+++ libcxx/.clang-tidy
@@ -1,14 +1,17 @@
-InheritParentConfig: true
 Checks: >
   bugprone-copy-constructor-init,
   bugprone-dangling-handle,
   bugprone-infinite-loop,
+  bugprone-stringview-nullptr,
+  bugprone-use-after-move,
 
-  -llvm-else-after-return,
-  -llvm-header-guard,
-  -llvm-qualified-auto,
+  llvm-include-order,
+  llvm-namespace-comment,
 
-  -misc-unconventional-assign-operator,
+  misc-definitions-in-headers,
+  misc-misplaced-const,
+  misc-non-copyable-objects,
+  misc-uniqueptr-reset-release,
 
   modernize-loop-convert,
   modernize-redundant-void-arg,
@@ -16,7 +19,6 @@
   readability-duplicate-include,
   readability-function-cognitive-complexity,
   readability-function-size,
-  -readability-identifier-naming,
   readability-misplaced-array-index,
   readability-redundant-control-flow,
   readability-redundant-function-ptr-dereference,
@@ -34,6 +36,7 @@
 # bugprone-branch-clone,
 # bugprone-macro-parentheses,
 # cppcoreguidelines-prefer-member-initializer,
+# misc-unused-parameters,
 # modernize-use-bool-literals,
 # modernize-use-default-member-init,
 # modernize-use-equals-default,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127896.437296.patch
Type: text/x-patch
Size: 2320 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220615/d85e561b/attachment.bin>


More information about the libcxx-commits mailing list