diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-25 16:55:45 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-25 16:55:45 +0000 |
commit | 37545f747c61382bbf5291d28a47fef6fc4d2d0e (patch) | |
tree | d2e58c43721336cda82aa7e36b49ce3aa10e34fe /lib/Sema/SemaLambda.cpp | |
parent | 1c42a7d28ea54606d2edde52789b4b55bb27a561 (diff) |
Rename getResultType() on function and method declarations to getReturnType()
A return type is the declared or deduced part of the function type specified in
the declaration.
A result type is the (potentially adjusted) type of the value of an expression
that calls the function.
Rule of thumb:
* Declarations have return types and parameters.
* Expressions have result types and arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200082 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 2023c1f61e..ac3f2efb5b 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/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); } |