[cfe-dev] CurContext during variable capture for Lambda

Eli Friedman eli.friedman at gmail.com
Wed Jan 2 15:56:54 PST 2013


On Tue, Dec 25, 2012 at 4:39 PM, Manjunath Kudlur <keveman at gmail.com> wrote:
> I was going through the Sema::tryCaptureVariable function. I noticed that
> when PerformCopyInitialization is called for variables of record types, it
> eventually does the lookup and resolution of the copy constructor for those
> types. During that entire machinery, the Sema::CurContext is set to the
> MethodDecl of the operator() of the Lambda. Given that the copy actually
> happens outside the operator() of the lambda, shouldn't CurContext point to
> the parent context during that time? Or am I missing something?

Your analysis appears to be correct.  That said, I can't think of any
case where it would actually make a difference...

-Eli



More information about the cfe-dev mailing list