================ @@ -3922,16 +3922,41 @@ def LifetimeCaptureByDocs : Documentation { let Category = DocCatFunction; let Content = [{ Similar to `lifetimebound`_, the ``lifetime_capture_by(X)`` attribute on a function -parameter or implicit object parameter indicates that that objects that are referred to -by that parameter may also be referred to by the capturing entity ``X``. +parameter or implicit object parameter indicates that objects that are referred to by +that parameter may also be referred to by a capturing entity ``X``. + +Below is a list of types of the parameters and what they're considered to refer to: + +- A reference param is considered to refer to its referenced object. +- A pointer param is considered to refer to its pointee. +- A ``std::initializer_list<T>`` is considered to refer to its underlying array. +- Aggregates (arrays and simple ``struct``\s) are considered to refer to all ---------------- usx95 wrote:
Added a `captureVector` case. Let me know if you wanted something else. > `void capture(MyStruct abc [[clang::LCB]])` I plan to add a an error in a followup for this case. I plan to enforce that the param must be `gsl::Pointer` or reference type. WDYT ? https://github.com/llvm/llvm-project/pull/115921 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits