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))); ^