================
@@ -3279,8 +3279,80 @@ struct [[gsl::Pointer]] function_ref {
 // avoid this warning for non-capturing lambdas.
 void assign_non_capturing_to_function_ref(function_ref &r) {
   r = []() {}; // expected-warning {{object whose reference is captured does 
not live long enough}} \
-               // expected-note {{destroyed here}}
+               // expected-note {{destroyed here}} function-note {{requested 
here}}
   (void)r; // expected-note {{later used here}}
 }
 
 } // namespace GH126600
+
+namespace LifetimeboundReturnVerification {
+
+bool cond();
+
+View drop_lb(const MyObj &obj) { return obj; }
+
+View keep_lb(const MyObj &obj [[clang::lifetimebound]]) {
+  return obj;
+}
----------------
usx95 wrote:

I would not keep inference related tests here. The idea is to minimum 
divergence in this file among the test modes and use `expected` prefix as much 
as we can.

A Simple fix would be to drop the function bodies for both the functions here.
Maybe also rename to `not_lb` and `lb` for these.

https://github.com/llvm/llvm-project/pull/196144
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to