diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -2779,15 +2779,15 @@ /// /// By default, performs semantic analysis to build the new expression. /// Subclasses may override this routine to provide different behavior. - ExprResult RebuildExtVectorElementExpr(Expr *Base, - SourceLocation OpLoc, - SourceLocation AccessorLoc, - IdentifierInfo &Accessor) { + ExprResult RebuildExtVectorElementExpr(Expr *Base, SourceLocation OpLoc, + bool IsArrow, + SourceLocation AccessorLoc, + IdentifierInfo &Accessor) { CXXScopeSpec SS; DeclarationNameInfo NameInfo(&Accessor, AccessorLoc); return getSema().BuildMemberReferenceExpr(Base, Base->getType(), - OpLoc, /*IsArrow*/ false, + OpLoc, IsArrow, SS, SourceLocation(), /*FirstQualifierInScope*/ nullptr, NameInfo, @@ -11385,9 +11385,9 @@ // FIXME: Bad source location SourceLocation FakeOperatorLoc = SemaRef.getLocForEndOfToken(E->getBase()->getEndLoc()); - return getDerived().RebuildExtVectorElementExpr(Base.get(), FakeOperatorLoc, - E->getAccessorLoc(), - E->getAccessor()); + return getDerived().RebuildExtVectorElementExpr( + Base.get(), FakeOperatorLoc, E->isArrow(), E->getAccessorLoc(), + E->getAccessor()); } template diff --git a/clang/test/SemaTemplate/instantiate-clang.cpp b/clang/test/SemaTemplate/instantiate-clang.cpp --- a/clang/test/SemaTemplate/instantiate-clang.cpp +++ b/clang/test/SemaTemplate/instantiate-clang.cpp @@ -18,7 +18,15 @@ template struct ExtVectorAccess0; template struct ExtVectorAccess0; -typedef __attribute__(( ext_vector_type(2) )) double double2; +template +struct ExtVectorAccess1 { + void f(T *v1, double4 *v2) { + v1->xy = v2->yx; + } +}; + +template struct ExtVectorAccess1; +template struct ExtVectorAccess1; template struct ShuffleVector0 {