[clang] [analyzer] Revert incorrect LazyCoumpoundVal changes (PR #163461)
Marco Borgeaud via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 31 08:01:06 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.
----------------
marco-antognini-sonarsource wrote:
I realise it was not obvious at all -- I've rephrase it.
The intend was to say, there is no `parts = other.parts;` after the `delete`.
Let me know if this is clearer now after 904f919f22f2d2b7177c86ebbeafd46ddf36e234
https://github.com/llvm/llvm-project/pull/163461
More information about the cfe-commits
mailing list