[clang] Reland: [clang] Diagnose dangling issues for the "Container<GSLPointer>" case. #107213 (PR #108344)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 13:29:44 PDT 2024


================
@@ -633,4 +633,12 @@ std::optional<int*> test4(int a) {
   return std::make_optional(nullptr); // fine
 }
 
+template <typename T>
+struct [[gsl::Owner]] StatusOr {
+  const T &value() [[clang::lifetimebound]];
+};
----------------
hokein wrote:

Thanks a lot for these tests. I've added them with some adjustments.

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


More information about the cfe-commits mailing list