$ cat this.cc struct Foo; void foo (int& (Foo::*) () __attribute__ ((returns_nonnull))); $ g++ this.cc -c this.cc:4:55: warning: ‘returns_nonnull’ attribute directive ignored [-Wattributes] foo (int& (Foo::*) () __attribute__ ((returns_nonnull))); ^
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))); ^
I will try to resolve this.
Author: paolo Date: Wed Apr 16 20:17:46 2014 New Revision: 209447 URL: http://gcc.gnu.org/viewcvs?rev=209447&root=gcc&view=rev Log: 2014-04-16 Patrick Palka <patrick@parcs.ath.cx> PR c++/60765 * decl2.c (cplus_decl_attributes): Handle pointer-to-member-function declarations. 2014-04-16 Patrick Palka <patrick@parcs.ath.cx> PR c++/60764 * call.c (build_user_type_coversion): Use build_dummy_object to create the placeholder object for a constructor method call. (build_special_member_call): Likewise. (build_over_call): Check for the placeholder object with is_dummy_object. (build_new_method_call_1): Likewise. Don't attempt to resolve a dummy object for a constructor method call. Added: trunk/gcc/testsuite/g++.dg/ext/attrib49.C trunk/gcc/testsuite/g++.dg/warn/nonnull2.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/cp/decl2.c trunk/gcc/testsuite/g++.dg/cpp0x/gen-attrs-36-1.C
Fixed.