[Bug c++/60765] Function attributes ignored for pointer-to-member-function parameters

patrick at parcs dot ath.cx gcc-bugzilla@gcc.gnu.org
Fri Apr 4 23:18:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60765

--- Comment #1 from patrick at parcs dot ath.cx ---
Oops, that warning is because I am currently compiling with G++ 4.8, which
doesn't implement returns_nonnull.  Here's a better test case:

$ cat this.cc
struct Foo;

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

$ g++ this.cc c
this.cc:3:52: warning: ‘nonnull’ attribute only applies to function types
[-Wattributes]
 void foo (void (Foo::*) () __attribute__ ((nonnull)));
                                                    ^


More information about the Gcc-bugs mailing list