Allow vector types in pseudo-destructor expressions. Fixes PR13798.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163514 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 4efab1b..0905607 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -5045,7 +5045,8 @@
   if (CheckArrow(*this, ObjectType, Base, OpKind, OpLoc))
     return ExprError();
 
-  if (!ObjectType->isDependentType() && !ObjectType->isScalarType()) {
+  if (!ObjectType->isDependentType() && !ObjectType->isScalarType() &&
+      !ObjectType->isVectorType()) {
     if (getLangOpts().MicrosoftMode && ObjectType->isVoidType())
       Diag(OpLoc, diag::ext_pseudo_dtor_on_void) << Base->getSourceRange();
     else
diff --git a/test/SemaCXX/vector.cpp b/test/SemaCXX/vector.cpp
index 82245ac..4d2d064 100644
--- a/test/SemaCXX/vector.cpp
+++ b/test/SemaCXX/vector.cpp
@@ -267,3 +267,14 @@
   (void)(n *= m);
   (void)(n /= m);
 }
+
+template<typename T> void test_pseudo_dtor_tmpl(T *ptr) {
+  ptr->~T();
+  (*ptr).~T();
+}
+
+void test_pseudo_dtor(fltx4 *f) {
+  f->~fltx4();
+  (*f).~fltx4();
+  test_pseudo_dtor_tmpl(f);
+}