[libc++][clang-tidy] Enable bugprone-use-after-move and explicitly list all used checks

Reviewed By: #libc, ldionne

Spies: aheejin, libcxx-commits, xazax.hun

Differential Revision: https://reviews.llvm.org/D127896
This commit is contained in:
Nikolas Klauser 2022-06-15 10:21:19 +02:00
parent 80c04c664a
commit 26ac9cbf00
2 changed files with 12 additions and 9 deletions

View File

@ -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 @@ Checks: >
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 @@ CheckOptions:
# 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,

View File

@ -266,8 +266,8 @@ public:
_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 @@ public:
_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 @@ public:
_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