r210706 - Objective-C. Accept '__attribute__((__ns_returns_retained__))'

Argyrios Kyrtzidis kyrtzidis at apple.com
Thu Jun 12 09:43:41 PDT 2014


Could you add test cases for:

- an ObjC method returning block and getting annotated with the attribute
- a C++ method returning block

On Jun 11, 2014, at 2:22 PM, Fariborz Jahanian <fjahanian at apple.com> wrote:

> Added: cfe/trunk/test/SemaObjC/ns_returns_retained_block_return.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/ns_returns_retained_block_return.m?rev=210706&view=auto
> ==============================================================================
> --- cfe/trunk/test/SemaObjC/ns_returns_retained_block_return.m (added)
> +++ cfe/trunk/test/SemaObjC/ns_returns_retained_block_return.m Wed Jun 11 16:22:53 2014
> @@ -0,0 +1,18 @@
> +// RUN: %clang_cc1  -fblocks -fsyntax-only -verify -Wno-objc-root-class %s
> +// RUN: %clang_cc1 -x objective-c++ -fblocks -fsyntax-only -verify -Wno-objc-root-class %s
> +// RUN: %clang_cc1  -fblocks -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
> +// RUN: %clang_cc1 -x objective-c++ -fblocks -fobjc-arc -fsyntax-only -verify -Wno-objc-root-class %s
> +// expected-no-diagnostics
> +// rdar://17259812
> +
> +typedef void (^BT) ();
> +
> +BT foo()  __attribute__((ns_returns_retained));
> +
> + at interface I
> +BT foo()  __attribute__((ns_returns_retained));
> + at end
> +
> + at implementation I
> +BT foo()  __attribute__((ns_returns_retained)) {return ^{}; }
> + at end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140612/5ed5479e/attachment.html>


More information about the cfe-commits mailing list