================
@@ -12,14 +22,32 @@ struct [[gsl::Pointer()]] View {
void use() const;
};
-View return_view_directly (View a) { // expected-warning {{param should be
marked [[clang::lifetimebound]]}}.
+View return_view_directly(View a); // expected-warning {{parameter in cross-TU
function should be marked [[clang::lifetimebound]]}}
+
+View conditional_return_view(
+ View a, // expected-warning {{parameter in cross-TU function should
be marked [[clang::lifetimebound]]}}
+ View b, // expected-warning {{parameter in cross-TU function should
be marked [[clang::lifetimebound]]}}
+ bool c);
+
+int* return_pointer_directly(int* a); // expected-warning {{parameter in
cross-TU function should be marked [[clang::lifetimebound]]}}
+
+MyObj* return_pointer_object(MyObj* a); // expected-warning {{parameter in
cross-TU function should be marked [[clang::lifetimebound]]}}
+
+inline View inline_header_return_view(View a) { // expected-warning
{{parameter in cross-TU function should be marked [[clang::lifetimebound]]}}
+ return a; // expected-note {{param
returned here}}
+}
+
----------------
usx95 wrote:
Can you also add a function with definition here.
// Header
View foo(View a) { return a; }
View bar(View a);
View bar(View a) { return a; }
// Use them in .cc file.
I expect these to be intra-TU suggestions.
https://github.com/llvm/llvm-project/pull/171972
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits