https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79962
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- We used to reject the code with: k.cc: In substitution of ‘template<class T> void f(typename T::U) [with T = S]’: k.cc:8:9: required from here k.cc:2:6: error: nonnull argument has invalid operand number (argument 1) void f (typename T::U) __attribute__ ((__nonnull__ (T::i))); because ARG here: 2818 if (!get_nonnull_operand (arg, &arg_num)) 2819 { 2820 error ("nonnull argument has invalid operand number (argument %lu)", 2821 (unsigned long) attr_arg_num); used to be const_decl, but since the default_conversion call, it's integer_cst.