[libcxx-commits] [libcxx] Add lifetimebound to std::basic_string::operator std::string_view (PR #112614)
Utkarsh Saxena via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 16 14:19:44 PDT 2024
usx95 wrote:
I feel this could be dealt with the generic GSL owner-to-pointer conversion. Also, we prefer not to annotate the library and instead `inferLifetimebound`. This allows clang to diagnose cases irrespective of the underlying library.
That said, I don't think we need any of that to fix this bug. For example, we already do a good job when GSL pointers and lifetimebound interact as in the bug: https://godbolt.org/z/9M9PsEGs7
I feel we need to fix the analysis for assignment operator [here](https://github.com/llvm/llvm-project/blob/2b6b7f664d9c93877ce6678820255fc006d56b54/clang/lib/Sema/CheckExprLifetime.cpp#L1447-L1450) which would fix cases beyond `std::string_view`.
cc: @Xazax-hun @hokein
https://github.com/llvm/llvm-project/pull/112614
More information about the libcxx-commits
mailing list