This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/79962] [5/6/7 Regression] ICE nonnull_check_p on a function template with a type-dependent attribute nonnull
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Mar 2017 11:01:39 +0000
- Subject: [Bug c++/79962] [5/6/7 Regression] ICE nonnull_check_p on a function template with a type-dependent attribute nonnull
- Auto-submitted: auto-generated
- References: <bug-79962-4@http.gcc.gnu.org/bugzilla/>
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.