[AST] Fix a crash on a dependent vector_size attribute

Looks like this was just a copy & paste mistake from
getDependentSizedExtVectorType. rdar://60092165

Differential revision: https://reviews.llvm.org/D79012
This commit is contained in:
Erik Pilkington 2020-04-28 12:24:54 -04:00
parent d9786b566b
commit 2bb686b4b6
2 changed files with 12 additions and 3 deletions

View File

@ -3694,10 +3694,10 @@ ASTContext::getDependentVectorType(QualType VecType, Expr *SizeExpr,
(void)CanonCheck;
DependentVectorTypes.InsertNode(New, InsertPos);
} else {
QualType CanonExtTy = getDependentSizedExtVectorType(CanonVecTy, SizeExpr,
SourceLocation());
QualType CanonTy = getDependentVectorType(CanonVecTy, SizeExpr,
SourceLocation(), VecKind);
New = new (*this, TypeAlignment) DependentVectorType(
*this, VecType, CanonExtTy, SizeExpr, AttrLoc, VecKind);
*this, VecType, CanonTy, SizeExpr, AttrLoc, VecKind);
}
}

View File

@ -475,3 +475,12 @@ void use() {
#endif // __cplusplus >= 201103L
}
}
namespace rdar60092165 {
template <class T> void f() {
typedef T first_type __attribute__((vector_size(sizeof(T) * 4)));
typedef T second_type __attribute__((vector_size(sizeof(T) * 4)));
second_type st;
}
}