[clang] [Clang][Sema] Disallow applying `onwership_returns` to functions that return non-pointers (PR #99564)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 27 08:06:44 PDT 2024


================
@@ -3330,6 +3330,8 @@ def err_attribute_invalid_implicit_this_argument : Error<
   "%0 attribute is invalid for the implicit this argument">;
 def err_ownership_type : Error<
   "%0 attribute only applies to %select{pointer|integer}1 arguments">;
+def err_ownership_takes_return_type : Error<
+  "'ownership_returns' attribute only applies to functions that return pointers">;
----------------
AaronBallman wrote:

```suggestion
  "'ownership_returns' attribute only applies to functions that return a pointer">;
```

https://github.com/llvm/llvm-project/pull/99564


More information about the cfe-commits mailing list