[Bug c++/79962] [5/6/7 Regression] ICE nonnull_check_p on a function template with a type-dependent attribute nonnull

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 9 11:01:00 GMT 2017


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.


More information about the Gcc-bugs mailing list