[PATCH] Support nonnull attribute on block expressions

Aaron Ballman aaron at aaronballman.com
Wed Apr 29 11:59:41 PDT 2015


PR23416 points out that we currently diagnose nonnull properly on a
block declaration, but not on a block expression. Specifically:

void(^bp)(int *) __attribute__((nonnull(1)));
void f() {
    bp(0); // Diagnose this already
    ^(int *p1) __attribute__((nonnull(1))) {}(0); // Not diagnosing this
}

It seems reasonable and relatively straight-forward to support the
BlockExpr case as well. The attached patch is a stab at implementing
support for this, but since my ObjC-fu is weak (at best), I am
wondering if I'm missing something.

Thanks!

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NonnullBlockExpr.patch
Type: application/octet-stream
Size: 6041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150429/9a8cba79/attachment.obj>


More information about the cfe-commits mailing list