================
@@ -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]]}}
----------------
usx95 wrote:
I expect this to be intra-TU. The reason is that this definition is available
to all TU including this header and inference can take care of this annotation.
Moving linkage rule to `getCrossTUDecl` should make this fine.
https://github.com/llvm/llvm-project/pull/171972
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits