<div dir="ltr"><div>On 26 September 2013 12:54, Faisal Vali <span dir="ltr"><<a href="mailto:faisalv@yahoo.com" target="_blank">faisalv@yahoo.com</a>></span> wrote:<br></div><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: faisalv<br>
Date: Thu Sep 26 14:54:12 2013<br>
New Revision: 191453<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=191453&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=191453&view=rev</a><br>
Log:<br>
Implement a rudimentary form of generic lambdas.<br>
<br>
Specifically, the following features are not included in this commit:<br>
  - any sort of capturing within generic lambdas<br>
  - generic lambdas within template functions and nested<br>
    within other generic lambdas<br>
  - conversion operator for captureless lambdas<br>
  - ensuring all visitors are generic lambda aware<br>
  (Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit)<br></blockquote><div><br></div><div>[...]</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=191453&r1=191452&r2=191453&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=191453&r1=191452&r2=191453&view=diff</a><br>


==============================================================================<br>
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)<br>
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Thu Sep 26 14:54:12 2013<br>
@@ -10,7 +10,7 @@<br>
 // This file implements the Expression parsing implementation for C++.<br>
 //<br>
 //===----------------------------------------------------------------------===//<br>
-<br>
+#include "clang/AST/DeclTemplate.h"<br>
 #include "clang/Parse/Parser.h"<br>
 #include "RAIIObjectsForParser.h"<br>
 #include "clang/Basic/PrettyStackTrace.h"<br>
@@ -21,6 +21,7 @@<br>
 #include "clang/Sema/Scope.h"<br>
 #include "llvm/Support/ErrorHandling.h"<br>
<br>
+<br>
 using namespace clang;<br>
<br>
 static int SelectDigraphErrorMessage(tok::TokenKind Kind) {<br>
@@ -908,12 +909,16 @@ ExprResult Parser::ParseLambdaExpression<br>
   PrettyStackTraceLoc CrashInfo(PP.getSourceManager(), LambdaBeginLoc,<br>
                                 "lambda expression parsing");<br>
<br>
+<br>
+<br>
   // FIXME: Call into Actions to add any init-capture declarations to the<br>
   // scope while parsing the lambda-declarator and compound-statement.<br>
<br>
   // Parse lambda-declarator[opt].<br>
   DeclSpec DS(AttrFactory);<br>
   Declarator D(DS, Declarator::LambdaExprContext);<br>
+  TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);<br>
+  Actions.PushLambdaScope();<br>
<br>
   if (Tok.is(tok::l_paren)) {<br>
     ParseScope PrototypeScope(this,<br>
@@ -931,9 +936,16 @@ ExprResult Parser::ParseLambdaExpression<br>
     SmallVector<DeclaratorChunk::ParamInfo, 16> ParamInfo;<br>
     SourceLocation EllipsisLoc;<br>
<br>
-    if (Tok.isNot(tok::r_paren))<br>
+<br>
+    if (Tok.isNot(tok::r_paren)) {<br>
+      sema::LambdaScopeInfo *LSI = Actions.getCurLambda();<br></blockquote><div><br></div><div><span style="font-size:13px;font-family:arial,sans-serif">tools/</span><u style="font-size:13px;font-family:arial,sans-serif"></u><span style="font-size:13px;font-family:arial,sans-serif">cl</span><span style="font-size:13px;font-family:arial,sans-serif">ang/lib/Parse/ParseExprCXX.</span><u style="font-size:13px;font-family:arial,sans-serif"></u><span style="font-size:13px;font-family:arial,sans-serif">cpp</span><span style="font-size:13px;font-family:arial,sans-serif">:943:30: error: unused variable 'LSI' [-Werror,-Wunused-variable]</span><br style="font-size:13px;font-family:arial,sans-serif">

<span style="font-size:13px;font-family:arial,sans-serif">      sema::LambdaScopeInfo *LSI = Actions.getCurLambda();</span><br style="font-size:13px;font-family:arial,sans-serif"><span style="font-size:13px;font-family:arial,sans-serif">                             ^</span><br style="font-size:13px;font-family:arial,sans-serif">

<span style="font-size:13px;font-family:arial,sans-serif">1 error generated.</span><br></div><div> <br></div><div>Nick</div><div><br></div></div></div></div>