This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c++/60065.
- From: Jason Merrill <jason at redhat dot com>
- To: Adam Butcher <adam at jessamine dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org, Volker Reichelt <reichelt at gcc dot gnu dot org>
- Date: Fri, 21 Feb 2014 10:49:07 -0500
- Subject: Re: [PATCH] Fix PR c++/60065.
- Authentication-results: sourceware.org; auth=none
- References: <1392865210-1632-1-git-send-email-adam at jessamine dot co dot uk> <53062ABE dot 6000805 at redhat dot com> <eeef660261ba589dda2c38f54b95ce85 at imap dot force9 dot net>
On 02/21/2014 03:19 AM, Adam Butcher wrote:
A class template with an out-of-line generic function definition will
give the same issue I think:
template <typename T>
void A<T>::f(auto x) {} // should inject a new list
Right. template_class_depth should be useful here. This is basically
the same question as whether a particular member function is a primary
template (member template) or not, but figuring it out in the middle of
the parameter list complicates things.
Once it's resolved I think it'd be useful to create a new function to
determine this rather than doing the scope walk in a number of places.
Something like 'templ_parm_scope_for_fn_being_declared' --- or hopefully
some more elegant name!
Right.
Why doesn't num_template_parameter_lists work as a predicate here?
It works in the lambda case as it is updated there, but for generic
functions I think the following prevents it:
cp/parser.c:17063:
/* Inside the function parameter list, surrounding
template-parameter-lists do not apply. */
saved_num_template_parameter_lists
= parser->num_template_parameter_lists;
parser->num_template_parameter_lists = 0;
Hmm, I wonder what that's for? What breaks when you remove it? :)
Jason