================
@@ -406,7 +406,7 @@ void use() {
   strings.insert(strings.begin(), std::string());
 
   std::vector<const std::string*> pointers;
-  pointers.push_back(getLifetimeBoundPointer(std::string())); // 
expected-warning {{object whose reference is captured by 'pointers' will be 
destroyed at the end of the full-expression}}
+  pointers.push_back(getLifetimeBoundPointer(std::string()));
----------------
Xazax-hun wrote:

For a follow-up PR, but I wonder if we can actually get this diagnostic back in 
the future. I think in case the pointer originates from a gsl owner, it is a 
strong indication that we care about the lifetime of the pointee and not the 
pointer itself and the capture_by annotation is what we actually want. 

But I am also OK never supporting this scenario as it starts to get a bit 
convoluted. 

https://github.com/llvm/llvm-project/pull/122240
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to