[clang] [NFC][Clang] Fix Static Code Analysis Concerns with copy without assign (PR #75091)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 12:00:43 PST 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (smanna12)

<details>
<summary>Changes</summary>

This patch adds missing assignment operator to the class which has user-defined copy constructor.

---
Full diff: https://github.com/llvm/llvm-project/pull/75091.diff


1 Files Affected:

- (modified) clang/utils/TableGen/SveEmitter.cpp (+2) 


``````````diff
diff --git a/clang/utils/TableGen/SveEmitter.cpp b/clang/utils/TableGen/SveEmitter.cpp
index b8a1fb4bab0f4..e7bc63f0af903 100644
--- a/clang/utils/TableGen/SveEmitter.cpp
+++ b/clang/utils/TableGen/SveEmitter.cpp
@@ -90,6 +90,8 @@ class SVEType {
     NumVectors = NumV;
   }
 
+  SVEType &operator=(const SVEType &) = delete;
+
   bool isPointer() const { return Pointer; }
   bool isVoidPointer() const { return Pointer && Void; }
   bool isSigned() const { return Signed; }

``````````

</details>


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


More information about the cfe-commits mailing list