https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79961

--- Comment #6 from Pedro Alves <palves at redhat dot com> ---
I remembered to check what does G++ say when you apply the nonnull to a
non-pointer argument.  We get a hard error:

$ /opt/gcc/bin/g++ nonnull.cc -o nonnull -c
nonnull.cc:5:67: error: nonnull argument references non-pointer operand
(argument 1, operand 2)
   void foo (int, const char *arg) __attribute__ ((__nonnull__ (2)));
                                                                   ^

I think this sets precedent for a hard error on the implicit "this" argument.

Reply via email to