diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 16eb8206dba2..b806adf36bfb 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -1508,7 +1508,7 @@ CXXMethodDecl *CXXRecordDecl::getLambdaCallOperator() const { CXXMethodDecl* CXXRecordDecl::getLambdaStaticInvoker() const { CXXMethodDecl *CallOp = getLambdaCallOperator(); - CallingConv CC = CallOp->getType()->getAs()->getCallConv(); + CallingConv CC = CallOp->getType()->castAs()->getCallConv(); return getLambdaStaticInvoker(CC); } @@ -1532,8 +1532,8 @@ CXXMethodDecl *CXXRecordDecl::getLambdaStaticInvoker(CallingConv CC) const { DeclContext::lookup_result Invoker = getLambdaStaticInvokers(*this); for (NamedDecl *ND : Invoker) { - const FunctionType *FTy = - cast(ND->getAsFunction())->getType()->getAs(); + const auto *FTy = + cast(ND->getAsFunction())->getType()->castAs(); if (FTy->getCallConv() == CC) return getInvokerAsMethod(ND); }