forked from OSchip/llvm-project
SemaExpr.cpp - use castAs<> instead of getAs<> as we dereference the pointer directly. NFCI.
castAs<> will assert the correct cast type instead of just returning null, which we then try to dereference immediately.
This commit is contained in:
parent
7e7106d104
commit
6d56823116
|
@ -15166,7 +15166,7 @@ void Sema::ActOnBlockArguments(SourceLocation CaretLoc, Declarator &ParamInfo,
|
||||||
CurBlock->TheDecl->setSignatureAsWritten(Sig);
|
CurBlock->TheDecl->setSignatureAsWritten(Sig);
|
||||||
CurBlock->FunctionType = T;
|
CurBlock->FunctionType = T;
|
||||||
|
|
||||||
const FunctionType *Fn = T->getAs<FunctionType>();
|
const auto *Fn = T->castAs<FunctionType>();
|
||||||
QualType RetTy = Fn->getReturnType();
|
QualType RetTy = Fn->getReturnType();
|
||||||
bool isVariadic =
|
bool isVariadic =
|
||||||
(isa<FunctionProtoType>(Fn) && cast<FunctionProtoType>(Fn)->isVariadic());
|
(isa<FunctionProtoType>(Fn) && cast<FunctionProtoType>(Fn)->isVariadic());
|
||||||
|
|
Loading…
Reference in New Issue