[cfe-commits] r51311 - in /cfe/trunk: lib/Parse/Parser.cpp test/Parser/traditional_arg_scope.c

Argiris Kirtzidis akyrtzi at gmail.com
Tue May 20 08:24:15 PDT 2008


Hi Eli,

Eli Friedman wrote:
> Author: efriedma
> Date: Tue May 20 04:10:20 2008
> New Revision: 51311
>
> URL: http://llvm.org/viewvc/llvm-project?rev=51311&view=rev
> Log:
> Fix the scope of K&R-style argument declarations so that they don't 
> extend beyond the end of the function.
>
> I'm not completely sure this is the right way to fix this bug, so 
> someone familiar with the parser should double-check.
>
> [snip]
>  
>    // Enter function-declaration scope, limiting any declarators to the
>    // function prototype scope, including parameter declarators.
> -  EnterScope(Scope::DeclScope);
> +  EnterScope(Scope::FnScope|Scope::DeclScope);
>   

This is the right way. This bug is because of a change of mine, where 
declarations become "out of reach for name lookup" only when they are 
inside a FnScope.
I had missed K&R params, thanks for fixing it!


-Argiris



More information about the cfe-commits mailing list