================
@@ -161,33 +167,52 @@ static View return_view_static(View a) {  // 
expected-warning {{parameter in int
   return a;                               // expected-note {{param returned 
here}} 
 }
 
-//===----------------------------------------------------------------------===//
-// FIXME Test Cases
-//===----------------------------------------------------------------------===//
+const ReturnThis& ReturnThis::get() const {
+  return *this;                       // expected-note {{param returned here}}
+}
 
 struct ReturnsSelf {
-  const ReturnsSelf& get() const {
-    return *this;
+  ReturnsSelf() {}
+  ~ReturnsSelf() {}
+  const ReturnsSelf& get() const { // expected-warning {{implicit this in 
intra-TU function should be marked [[clang::lifetimebound]]}}.
+    return *this;                  // expected-note {{param returned here}}
   }
 };
 
+struct ReturnThisAnnotated {
+  const ReturnThisAnnotated& get() [[clang::lifetimebound]] { return *this; }
+};
+
 struct ViewProvider {
+  ViewProvider() {}
+  ViewProvider(int d) : data(d) {}
----------------
usx95 wrote:

Why do we need this ctor ?

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

Reply via email to