diff options
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 2023c1f61e3..ac3f2efb5b8 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -364,7 +364,7 @@ CXXMethodDecl *Sema::startLambdaDefinition(CXXRecordDecl *Class, // dependent type. if (Class->isDependentContext() || TemplateParams) { const FunctionProtoType *FPT = MethodType->castAs<FunctionProtoType>(); - QualType Result = FPT->getResultType(); + QualType Result = FPT->getReturnType(); if (Result->isUndeducedType()) { Result = SubstAutoType(Result, Context.DependentTy); MethodType = Context.getFunctionType(Result, FPT->getParamTypes(), @@ -456,8 +456,8 @@ void Sema::buildLambdaScope(LambdaScopeInfo *LSI, LSI->Mutable = Mutable; if (ExplicitResultType) { - LSI->ReturnType = CallOperator->getResultType(); - + LSI->ReturnType = CallOperator->getReturnType(); + if (!LSI->ReturnType->isDependentType() && !LSI->ReturnType->isVoidType()) { if (RequireCompleteType(CallOperator->getLocStart(), LSI->ReturnType, @@ -1165,7 +1165,7 @@ static void addFunctionPointerConversion(Sema &S, assert(InvokerExtInfo.RefQualifier == RQ_None && "Lambda's call operator should not have a reference qualifier"); InvokerFunctionTy = - S.Context.getFunctionType(CallOpProto->getResultType(), + S.Context.getFunctionType(CallOpProto->getReturnType(), CallOpProto->getParamTypes(), InvokerExtInfo); PtrToFunctionTy = S.Context.getPointerType(InvokerFunctionTy); } @@ -1332,7 +1332,7 @@ static void addBlockPointerConversion(Sema &S, FunctionProtoType::ExtProtoInfo ExtInfo = Proto->getExtProtoInfo(); ExtInfo.TypeQuals = 0; QualType FunctionTy = S.Context.getFunctionType( - Proto->getResultType(), Proto->getParamTypes(), ExtInfo); + Proto->getReturnType(), Proto->getParamTypes(), ExtInfo); BlockPtrTy = S.Context.getBlockPointerType(FunctionTy); } |

