[clang] [clang] Fix the post-filtering heuristic for GSLPointer. (PR #114044)

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 06:00:58 PST 2024


================
@@ -793,3 +794,44 @@ void test13() {
 }
 
 } // namespace GH100526
+
+namespace LifetimeboundInterleave {
+
+const std::string& Ref(const std::string& abc [[clang::lifetimebound]]);
----------------
usx95 wrote:

Can you also add the following tests:
`std::string_view TakeSv(std::string_view abc [[clang::lifetimebound]]);`
`std::string_view sv = TakeSv(std::string()); // warning.`

`std::string_view TakeStrRef(const std::string& abc [[clang::lifetimebound]]);`
`std::string_view sv = TakeStrRef(std::string()); // warning.`

`std::string_view TakeStr(std::string abc [[clang::lifetimebound]]);`
`std::string_view sv = TakeStr(std::string()); // Ok.`


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


More information about the cfe-commits mailing list