Author: Aaron Ballman Date: 2025-06-26T06:58:56-04:00 New Revision: 95149011ea010a4b0ca0e9700437090ae582f8e5
URL: https://github.com/llvm/llvm-project/commit/95149011ea010a4b0ca0e9700437090ae582f8e5 DIFF: https://github.com/llvm/llvm-project/commit/95149011ea010a4b0ca0e9700437090ae582f8e5.diff LOG: Guard against self-assignment; NFC (#145743) This was caught by a static analysis tool and seemed like a reasonable code quality improvement. Added: Modified: clang/include/clang/AST/Type.h Removed: ################################################################################ diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index 24f3ae78e857b..1a87608e5be34 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -6409,12 +6409,7 @@ class SpirvOperand { SpirvOperand(const SpirvOperand &Other) { *this = Other; } ~SpirvOperand() {} - SpirvOperand &operator=(const SpirvOperand &Other) { - this->Kind = Other.Kind; - this->ResultType = Other.ResultType; - this->Value = Other.Value; - return *this; - } + SpirvOperand &operator=(const SpirvOperand &Other) = default; bool operator==(const SpirvOperand &Other) const { return Kind == Other.Kind && ResultType == Other.ResultType && _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits