diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-17 11:12:31 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-10-17 11:12:31 +0000 |
commit | e14851259e770a59db736964475ebd152fe1c793 (patch) | |
tree | 3132f1e74af77428dfe9b80e2d33dcf311916e14 | |
parent | fda3243fdd9880441af11dd39a3120b3874fd42c (diff) | |
download | bcm5719-llvm-e14851259e770a59db736964475ebd152fe1c793.tar.gz bcm5719-llvm-e14851259e770a59db736964475ebd152fe1c793.zip |
SemaExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
llvm-svn: 375101
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index a7d8c5009b2..61203b0a0bf 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3302,7 +3302,7 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, // itself in this case. return ExprError(); - QualType Pointee = Type->getAs<PointerType>()->getPointeeType(); + QualType Pointee = Type->castAs<PointerType>()->getPointeeType(); QualType PointeeElem = Context.getBaseElementType(Pointee); if (Pointee.getAddressSpace() != LangAS::Default && @@ -4034,8 +4034,8 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, case ICK_Complex_Promotion: case ICK_Complex_Conversion: { - QualType FromEl = From->getType()->getAs<ComplexType>()->getElementType(); - QualType ToEl = ToType->getAs<ComplexType>()->getElementType(); + QualType FromEl = From->getType()->castAs<ComplexType>()->getElementType(); + QualType ToEl = ToType->castAs<ComplexType>()->getElementType(); CastKind CK; if (FromEl->isRealFloatingType()) { if (ToEl->isRealFloatingType()) |