Use v.data() instead of &v[0] when SmallVector v might be empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index d72d56f..e819b1c 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -5144,7 +5144,7 @@
CurBlock->Params.push_back(FTI.ArgInfo[i].Param.getAs<ParmVarDecl>());
CurBlock->isVariadic = FTI.isVariadic;
}
- CurBlock->TheDecl->setParams(Context, &CurBlock->Params[0],
+ CurBlock->TheDecl->setParams(Context, CurBlock->Params.data(),
CurBlock->Params.size());
CurBlock->TheDecl->setIsVariadic(CurBlock->isVariadic);
ProcessDeclAttributes(CurBlock->TheDecl, ParamInfo);
@@ -5215,7 +5215,7 @@
if (!BSI->hasPrototype)
BlockTy = Context.getFunctionNoProtoType(RetTy);
else
- BlockTy = Context.getFunctionType(RetTy, &ArgTypes[0], ArgTypes.size(),
+ BlockTy = Context.getFunctionType(RetTy, ArgTypes.data(), ArgTypes.size(),
BSI->isVariadic, 0);
// FIXME: Check that return/parameter types are complete/non-abstract