This revision was automatically updated to reflect the committed changes. Closed by commit rG2bb686b4b629: [AST] Fix a crash on a dependent vector_size attribute (authored by erik.pilkington). Herald added a project: clang.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79012/new/ https://reviews.llvm.org/D79012 Files: clang/lib/AST/ASTContext.cpp clang/test/SemaCXX/vector.cpp Index: clang/test/SemaCXX/vector.cpp =================================================================== --- clang/test/SemaCXX/vector.cpp +++ clang/test/SemaCXX/vector.cpp @@ -475,3 +475,12 @@ #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; +} +} Index: clang/lib/AST/ASTContext.cpp =================================================================== --- clang/lib/AST/ASTContext.cpp +++ clang/lib/AST/ASTContext.cpp @@ -3694,10 +3694,10 @@ (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); } }
Index: clang/test/SemaCXX/vector.cpp =================================================================== --- clang/test/SemaCXX/vector.cpp +++ clang/test/SemaCXX/vector.cpp @@ -475,3 +475,12 @@ #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; +} +} Index: clang/lib/AST/ASTContext.cpp =================================================================== --- clang/lib/AST/ASTContext.cpp +++ clang/lib/AST/ASTContext.cpp @@ -3694,10 +3694,10 @@ (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); } }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits