[cfe-commits] r150130 - /cfe/trunk/lib/Sema/SemaLambda.cpp

Douglas Gregor dgregor at apple.com
Wed Feb 8 17:28:43 PST 2012


Author: dgregor
Date: Wed Feb  8 19:28:42 2012
New Revision: 150130

URL: http://llvm.org/viewvc/llvm-project?rev=150130&view=rev
Log:
Along the error path for lambdas, mark the lambda class as invalid and finalize it

Modified:
    cfe/trunk/lib/Sema/SemaLambda.cpp

Modified: cfe/trunk/lib/Sema/SemaLambda.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLambda.cpp?rev=150130&r1=150129&r2=150130&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLambda.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLambda.cpp Wed Feb  8 19:28:42 2012
@@ -265,6 +265,16 @@
 
   // Leave the context of the lambda.
   PopDeclContext();
+
+  // Finalize the lambda.
+  LambdaScopeInfo *LSI = getCurLambda();
+  CXXRecordDecl *Class = LSI->Lambda;
+  Class->setInvalidDecl();
+  SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end());
+  ActOnFields(0, Class->getLocation(), Class, Fields, 
+              SourceLocation(), SourceLocation(), 0);
+  CheckCompletedCXXClass(Class);
+
   PopFunctionScopeInfo();
 }
 





More information about the cfe-commits mailing list