[cfe-commits] r150136 - in /cfe/trunk/lib/Sema: SemaDeclCXX.cpp SemaLambda.cpp
Douglas Gregor
dgregor at apple.com
Wed Feb 8 18:20:38 PST 2012
Author: dgregor
Date: Wed Feb 8 20:20:38 2012
New Revision: 150136
URL: http://llvm.org/viewvc/llvm-project?rev=150136&view=rev
Log:
Don't complain about the lack of a constructor for a lambda expression. They are constructed in different ways
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaLambda.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=150136&r1=150135&r2=150136&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Feb 8 20:20:38 2012
@@ -3632,7 +3632,8 @@
// complain about any non-static data members of reference or const scalar
// type, since they will never get initializers.
if (!Record->isInvalidDecl() && !Record->isDependentType() &&
- !Record->isAggregate() && !Record->hasUserDeclaredConstructor()) {
+ !Record->isAggregate() && !Record->hasUserDeclaredConstructor() &&
+ !Record->isLambda()) {
bool Complained = false;
for (RecordDecl::field_iterator F = Record->field_begin(),
FEnd = Record->field_end();
Modified: cfe/trunk/lib/Sema/SemaLambda.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLambda.cpp?rev=150136&r1=150135&r2=150136&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLambda.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLambda.cpp Wed Feb 8 20:20:38 2012
@@ -29,7 +29,7 @@
// Start constructing the lambda class.
CXXRecordDecl *Class = CXXRecordDecl::Create(Context, TTK_Class, DC,
Intro.Range.getBegin(),
- /*IdLoc=*/SourceLocation(),
+ /*IdLoc=*/Intro.Range.getBegin(),
/*Id=*/0);
Class->startDefinition();
Class->setLambda(true);
More information about the cfe-commits
mailing list