================
@@ -552,6 +552,20 @@ const int& get_ref_to_local() {
                       // expected-note@-1 {{returned here}}
 }
 
+View inference_callee_return_identity(View a) {
+  return a;
+}
+
+View inference_caller_forwards_callee(View a) {
+  return inference_callee_return_identity(a);
+}
+
+View inference_top_level_return_stack_view() {
+  MyObj local_stack;
+  return inference_caller_forwards_callee(local_stack);     // 
expected-warning {{address of stack memory is returned later}}
+                                                            // 
expected-note@-1 {{returned here}}
+}
+
----------------
usx95 wrote:

nit: contain these in a single namespace say `namespace simple_inference_test` 
as they all belong to a single test.

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

Reply via email to