[clang] [clang][dataflow] fix assert in `Environment::getResultObjectLocation` (PR #79608)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 30 11:44:11 PST 2024


================
@@ -2735,6 +2735,41 @@ TEST(TransferTest, ResultObjectLocationForDefaultInitExpr) {
       });
 }
 
+// This test ensures that CXXOperatorCallExpr returning prvalues are correctly
+// handled by the transfer functions, especially that `getResultObjectLocation`
+// correctly returns a storage location for those.
+TEST(TransferTest, ResultObjectLocationForCXXOperatorCallExpr) {
+  std::string Code = R"(
+    struct A {
+      virtual ~A() = default;
----------------
martinboehme wrote:

Any reason this needs to have a virtual destructor? This looks as if it's just copy-pasted from the ResultObjectLocation test above? Would suggest deleting this.

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


More information about the cfe-commits mailing list