================
@@ -89,6 +89,18 @@ void test_getView_on_temporary() {
(void)sv;
}
+//===----------------------------------------------------------------------===//
+// Annotation Inference Test Cases
+//===----------------------------------------------------------------------===//
+
+View return_view_by_func (View a) { // expected-warning {{param should be
marked [[clang::lifetimebound]]}}.
+ return return_view_directly(a); // expected-note {{param returned here}}
+}
+
+MyObj* return_pointer_by_func (MyObj* a) { // expected-warning {{param
should be marked [[clang::lifetimebound]]}}.
+ return return_pointer_object(a); // expected-note {{param
returned here}}
+}
----------------
usx95 wrote:
Please also add a negative test with these in the reverse order.
This is where a analysing the functions in a topological order of a call
hierarchy would help.
(same for the test below)
https://github.com/llvm/llvm-project/pull/171081
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits