llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang Author: Aaron Ballman (AaronBallman) <details> <summary>Changes</summary> This was caught by a static analysis tool and seemed like a reasonable code quality improvement. --- Full diff: https://github.com/llvm/llvm-project/pull/145743.diff 1 Files Affected: - (modified) clang/include/clang/AST/Type.h (+5-3) ``````````diff diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 24f3ae78e857b..f4d39afded322 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -6410,9 +6410,11 @@ class SpirvOperand { ~SpirvOperand() {} SpirvOperand &operator=(const SpirvOperand &Other) { - this->Kind = Other.Kind; - this->ResultType = Other.ResultType; - this->Value = Other.Value; + if (this != &Other) { + this->Kind = Other.Kind; + this->ResultType = Other.ResultType; + this->Value = Other.Value; + } return *this; } `````````` </details> https://github.com/llvm/llvm-project/pull/145743 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits