Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang tidy bugprone unhandled self assignment #58263

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ readability-*,\
-bugprone-narrowing-conversions,\
-bugprone-redundant-branch-condition,\
-bugprone-signed-char-misuse,\
-bugprone-unhandled-self-assignment,\
-cert-oop54-cpp,\
-cert-str34-c,\
-clang-analyzer-core.CallAndMessage,\
-clang-analyzer-deadcode.DeadStores,\
Expand Down Expand Up @@ -86,9 +84,11 @@ WarningsAsErrors: '*'
HeaderFilterRegex: '(src|test|tools).*'
FormatStyle: none
CheckOptions:
- key: readability-uppercase-literal-suffix.NewSuffixes
value: 'L;UL;LL;ULL'
- key: cata-text-style.EscapeUnicode
value: 0
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: true
- key: readability-uppercase-literal-suffix.NewSuffixes
value: 'L;UL;LL;ULL'

# vim:tw=0
8 changes: 2 additions & 6 deletions src/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,10 @@ JsonArray::JsonArray( JsonIn &j )

JsonArray::JsonArray( const JsonArray &ja )
{
jsin = ja.jsin;
start = ja.start;
index = 0;
positions = ja.positions;
end_ = ja.end_;
final_separator = ja.final_separator;
*this = ja;
}

// NOLINTNEXTLINE(bugprone-unhandled-self-assignment,cert-oop54-cpp)
JsonArray &JsonArray::operator=( const JsonArray &ja )
{
jsin = ja.jsin;
Expand Down
6 changes: 4 additions & 2 deletions src/safe_reference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ safe_reference_anchor::safe_reference_anchor( safe_reference_anchor && ) noexcep
safe_reference_anchor()
{}

safe_reference_anchor &safe_reference_anchor::operator=( const safe_reference_anchor & )
safe_reference_anchor &safe_reference_anchor::operator=( const safe_reference_anchor &other )
{
impl = std::make_shared<empty>();
if( this != &other ) {
impl = std::make_shared<empty>();
}
return *this;
}

Expand Down