This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 1/2] Fix PR c++/60065.
- From: Adam Butcher <adam at jessamine dot co dot uk>
- To: Jason Merrill <jason at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>, Volker Reichelt <reichelt at gcc dot gnu dot org>
- Date: Mon, 24 Feb 2014 20:05:15 +0000
- Subject: Re: [PATCH 1/2] Fix PR c++/60065.
- Authentication-results: sourceware.org; auth=none
- References: <bc26decc23fc6efec8f58af88f3e405e at imap dot force9 dot net> <1393227162-26306-1-git-send-email-adam at jessamine dot co dot uk> <530B8C7C dot 4060101 at redhat dot com>
On 2014-02-24 18:16, Jason Merrill wrote:
On 02/24/2014 02:32 AM, Adam Butcher wrote:
+static bool function_being_declared_is_template_p (cp_parser*
parser)
Function name should be at the beginning of the next line.
Doh! Fixed.
- if (scope->kind != sk_template_parms)
+ if (scope->kind != sk_template_parms
+ || !function_being_declared_is_template_p (parser))
Is there a reason not to move the scope->kind check into the new
function?
It is used within 'cp_parser_parameter_declaration_list' (PATCH 1/2)
without a need for a scope. The 'scope' here is the result of winding
back from the scope of the generic type parameter to beyond the function
and class scopes. I could have just used
if (!function_being_declared_is_template_p (parser))
here but it can be avoided if we ended up at a non-'sk_template_parms'
scope as we know already that there is no template parm list.
Adam