================
@@ -423,3 +423,15 @@ auto implicit_value_capture(int integer,
return [=]() { Foo(integer, ptr, ref, view); }; // expected-note 2 {{param
returned here}}
}
} // namespace lambda_captures
+
+namespace array {
+
+struct MemberArrayReturn {
+ int arr[10];
+
+ int* getFirst() { // expected-warning {{implicit this in intra-TU function
should be marked [[clang::lifetimebound]]}}
+ return &arr[0]; // expected-note {{param returned here}}
+ }
----------------
usx95 wrote:
can you also test for return the array itself as a pointer.
`int* getData() { return arr;}`
https://github.com/llvm/llvm-project/pull/186902
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits