[clang] Guard against self-assignment; NFC (PR #145743)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 25 10:45:19 PDT 2025


================
@@ -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) {
----------------
AaronBallman wrote:

That would require C++20, wouldn't it?

https://github.com/llvm/llvm-project/pull/145743


More information about the cfe-commits mailing list