[cfe-commits] r41877 - in /cfe/trunk: Driver/PrintParserCallbacks.cpp Parse/MinimalAction.cpp Parse/ParseDecl.cpp Parse/Parser.cpp Sema/Sema.h Sema/SemaDecl.cpp include/clang/Parse/Action.h

Chris Lattner clattner at apple.com
Wed Sep 12 11:17:29 PDT 2007


On Sep 12, 2007, at 7:07 AM, Steve Naroff wrote:

> Author: snaroff
> Date: Wed Sep 12 09:07:44 2007
> New Revision: 41877
>
> URL: http://llvm.org/viewvc/llvm-project?rev=41877&view=rev
> Log:
>
> Fix the following bug submitted by Ted Kremenek:
>
> void func() {
> int xx = xx; // incorrectly diagnosed 'xx' as an undeclared  
> identifier.
> }
>
> This smallish bug resulted in a largish fix. Here are some highlights:
>
> - Needed to make sure ParseDeclarator is called *before* parsing any
> initializer. Removed the "Init" argument to ParseDeclarator.
> - Added AddInitializerToDecl() to the Action & Sema classes.
> In Sema, this hook is responsible for validating the initializer and
> installing it into the respective decl.
> - Moved several semantic checks from ParseDeclarator() to
> FinalizeDeclaratorGroup(). Previously, this hook was only  
> responsible for
> reversing a list. Now it plays a much larger semantic role.
>
> All of the above changes ended up simplifying ParseDeclarator(), which
> is goodness...

Nice, I agree that the code looks even better than before!  Thanks  
Steve,

-Chris



More information about the cfe-commits mailing list