]> granicus.if.org Git - clang/commit
A quick fix to PR17877 that was introduced by r194188 (generic-lambda-capturing)...
authorFaisal Vali <faisalv@yahoo.com>
Tue, 12 Nov 2013 03:48:27 +0000 (03:48 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Tue, 12 Nov 2013 03:48:27 +0000 (03:48 +0000)
commit394558e6a1329b791de69d0fc7c618eac0dbc982
treede22b8a2f16e4552b73c4b6ffe21284493aaf534
parent2a7ff77d54c9783eb53a59cd57e9b2330cdd5119
A quick fix to PR17877 that was introduced by r194188 (generic-lambda-capturing) that broke libc++.

See http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-November/033369.html for discussion on cfe-dev.

This fix explicitly checks whether we are within the declcontext of a lambda's call operator - which is what I had intended to be true (and assumed would be true if getCurLambda returns a valid pointer) before checking whether a lambda can capture the potential-captures of the innermost lambda.

A deeper fix (that addresses why getCurLambda() returns a valid pointer when perhaps it shouldn't?) - as proposed by Richard Smith in http://llvm.org/bugs/show_bug.cgi?id=17877 - has been suggested as a FIXME.

Patch was LGTM'd by Richard (just barely :)

http://llvm-reviews.chandlerc.com/D2144

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194448 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaExprCXX.cpp
test/SemaCXX/cxx1y-generic-lambdas.cpp