[clang] [Clang][Sema] Disallow applying `onwership_returns` to functions that return non-pointers (PR #99564)
Pavel Skripkin via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 19 10:04:12 PDT 2024
================
@@ -1481,6 +1481,17 @@ static void handleOwnershipAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
break;
}
+ // Allow only pointers to be return type for functions with ownership_takes
+ // attribute. This matches with current OwnershipAttr::Takes semantics
+ if (K == OwnershipAttr::Returns) {
----------------
pskrgag wrote:
Yeah, typo. Thanks for spotting!
Fixed.
https://github.com/llvm/llvm-project/pull/99564
More information about the cfe-commits
mailing list