Fix function signature of binary +/- operator to not return a reference (#1523)

This function creates a new object on the stack, and was returning it as
a reference. This would trigger Clang 12's `-Wreturn-stack-address`
warning, and cause the build to fail.

This is a cherry-pick from #1285
main
Chris Burel 5 years ago committed by GitHub
parent f18ee01e68
commit 6f84a9df60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1149,13 +1149,13 @@ struct DiskOperationInfo
return *this;
}
DiskOperationInfo& operator - (const DiskOperationInfo& rv)
DiskOperationInfo operator - (const DiskOperationInfo& rv)
{
DiskOperationInfo res(*this);
return res -= rv;
}
DiskOperationInfo& operator + (const DiskOperationInfo& rv)
DiskOperationInfo operator + (const DiskOperationInfo& rv)
{
DiskOperationInfo res(*this);
return res += rv;

Loading…
Cancel
Save