faisalv added inline comments.

================
Comment at: lib/Sema/SemaTemplateInstantiateDecl.cpp:3922
@@ -3920,1 +3921,3 @@
+          *this, Var->getDeclContext(),
+          /*NewThisContext=*/!isLambdaCallOperator(getCurLexicalContext()));
       Init = SubstInitializer(OldVar->getInit(), TemplateArgs,
----------------
I don't think this is the right fix.  In my opinion, the fix should be to teach 
getCurrentThisType to recognize that we are in a context where a  lambda is 
being 'transformed' and correctly return the type of 'this', regardless of the 
containing-context of the lambda.  Also see the Richard-inspired FIXME to 
attempt to comprehensively handle such cases.

getCurrentThisType is broken though in some other ways currently (handling the 
cv qualification of lambda 'this' captures by value) - and i'm going to commit 
my patch to fix that later today.  Let me know if you'd like me to work on this 
next, or would prefer to take a crack at it yourself.

Thanks for looking into this - apologies for the delay in feedback.



http://reviews.llvm.org/D21145



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to