On 09/05/2012 06:52 PM, Paolo Carlini wrote:
On 09/05/2012 06:41 PM, Paolo Carlini wrote:
Thanks for looking into this. Now I wonder if we made progress on a
couple of long standing PRs where we weren't strict enough by one
with the number of 'template <>'. Let me check...
Nope, apparently c++/24314 is still there. But maybe it's easier to
fix now (I suspect however that the problem has to do with the logic
of num_template_headers_for_class, which I think you didn't change)
In fact, something seems weird earlier, in
cp_parser_check_template_parameters. It has:
/* If there are the same number of template classes and parameter
lists, that's OK. */
if (parser->num_template_parameter_lists == num_templates)
return true;
/* If there are more, but only one more, then we are referring to a
member template. That's OK too. */
if (parser->num_template_parameter_lists == num_templates + 1)
return true;
but note that for:
template <class T>
struct A
{
int select() { return 0; }
};
we have parser->num_template_parameter_lists == 1 and num_templates ==
0. Thus it seems that the case 'num_templates + 1' isn't (just) about
member templates...
Paolo.