[cfe-commits] [PATCH] Sema and AST for C++0x Lambda Expressions
jfreeman at cse.tamu.edu
Wed Nov 16 00:45:57 CST 2011
I finished integrating your LambdaScopeInfo changes with my work since
my last patch submission. Divergent branches aren't fun. :/
I saw you switched from using CheckFieldDecl to directly using
FieldDecl::Create. Was that intentional? I had the impression that the
extra semantic checking was preferred. Same question about switching
from ActOnIdExpression to directly using name lookup.
A few problems concerning the CXXMethodDecl (henceforth called Method):
A. I was trying to use ActOnStartOfFunctionDef to enter the DeclContext
owned by Method. You had used PushDeclContext directly. I believe that
will be necessary to avoid creating an extraneous FunctionScopeInfo, but
do we want any of the extra checking in ActOnStartOfFunctionDef?
B. A conundrum:
- PushDeclContext requires that the lexical DeclContext for Method be
- CXXRecordDecl::addDecl requires that the lexical DeclContext for
Method be the CXXRecordDecl (henceforth called Class).
How about this solution? :
3. Add Method to the LambdaScopeInfo so that it can be retrieved later
(we can't look it up in Class because we haven't called addDecl yet).
4. Parse body.
5. Retrieve Method from the LambdaScopeInfo.
6. ActOnFinishFunctionBody (calls PopDeclContext).
C. In a similar question to part A on ActOnStartOfFunctionDef vs
PushDeclContext, concerning step 6 above, do we want to use
PopDeclContext directly instead of ActOnFinishFunctionBody, or do we
want the extra semantic checks?
More information about the cfe-commits