Make sure that Type::getAs<ArrayType>() (or Type::getAs<subclass of
ArrayType>()) does not instantiate. Update all callers that used this
unsafe feature to use the appropriate ASTContext::getAs*ArrayType method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86596 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 93ef1ea..00dc809 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1704,7 +1704,7 @@
// class template specialization, or an array with known size of such,
// try to instantiate it.
QualType MaybeTemplate = T;
- if (const ConstantArrayType *Array = T->getAs<ConstantArrayType>())
+ if (const ConstantArrayType *Array = Context.getAsConstantArrayType(T))
MaybeTemplate = Array->getElementType();
if (const RecordType *Record = MaybeTemplate->getAs<RecordType>()) {
if (ClassTemplateSpecializationDecl *ClassTemplateSpec