[cfe-dev] Clang ignores nonnull attributes on pointer-to-member-function declarations

Richard Smith richard at metafoo.co.uk
Mon Jul 13 12:33:17 PDT 2015


On Mon, Jul 13, 2015 at 10:41 AM, Joerg Sonnenberger <
joerg at britannica.bec.de> wrote:

> On Mon, Jul 13, 2015 at 11:31:54AM -0400, Tom Honermann wrote:
> > Clang (3.4-trunk) ignores nonnull attributes on
> pointer-to-member-function
> > declarations.
>
> You are aware that 3.4-trunk is quite old and we are about to start the
> 3.7 release cycle?


I read that as "from version 3.4 to trunk". And it's true: clang trunk
still behaves as described. But I'm a bit confused, because the referenced
GCC bug report says they made this work:

struct Foo;
void foo (void (Foo::*) () __attribute__ ((nonnull)));

... where the attribute would presumably apply to the pointer-to-member,
and the request is to support this:

void (S::*pmf)(int *p1)
    __attribute__((nonnull));

... where the attribute (again, presumably) jumps over the
pointer-to-member and applies to the pointer parameter? This does not seem
consistent. What is the actual GCC behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150713/d250618c/attachment.html>


More information about the cfe-dev mailing list