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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375101 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index a7d8c50..61203b0 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -3302,7 +3302,7 @@
// 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 @@
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())