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

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 16:23:50 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]];
+};
----------------
usx95 wrote:

This is a nice test case for coverage of interactions between these two annotations.

Can you add more test cases (even if they were passing earlier) ?


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


More information about the cfe-commits mailing list