[clang] [llvm] [clang] Implement lifetime analysis for lifetime_capture_by(X) (PR #115921)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Sun Nov 17 23:29:07 PST 2024


================
@@ -0,0 +1,220 @@
+// RUN: %clang_cc1 --std=c++20 -fsyntax-only -Wdangling -Wdangling-field -Wreturn-stack-address -verify %s
+
+#include "Inputs/lifetime-analysis.h"
----------------
usx95 wrote:

I don't think that would be useful. Both lifetimebound and lifetime_capture share the semantics of STL types specially the inferred lifetimebound and gsl::Pointer/Owner. 

Also, I think it is useful to test how the stl types interact with other use defined types.

We often duplicate tests for both stl types and user defined types and I would prefer to keep the redundancy together in one place as compared to repeating similar tests to two different files.

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


More information about the cfe-commits mailing list