[clang] [analyzer] Revert incorrect LazyCoumpoundVal changes (PR #163461)

DonĂ¡t Nagy via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 27 07:55:04 PDT 2025


================
@@ -503,3 +503,75 @@ namespace optional_union {
     custom_union_t a;
   } // leak-warning{{Potential leak of memory pointed to by 'a.present.q'}}
 }
+
+namespace gh153782 {
+
+// Ensure we do not regress on the following use case.
+
+namespace mutually_exclusive_test_case_1 {
+struct StorageWrapper {
+  // Imagine those two call a reset() function (among other things)
+  ~StorageWrapper() { delete parts; }
+  StorageWrapper(StorageWrapper const&) = default;
+
+  // Mind that there is no assignment here -- this is the bug we would like to find.
----------------
NagyDonat wrote:

For a moment I was surprised to see this comment directly above the definition of a (move) assignment operator -- perhaps consider writing "copy assignment" to clarify.

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


More information about the cfe-commits mailing list