diff options
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 3 | ||||
-rw-r--r-- | test/SemaCXX/vector.cpp | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index 4efab1b83b..0905607e72 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -5045,7 +5045,8 @@ ExprResult Sema::BuildPseudoDestructorExpr(Expr *Base, 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 82245ac29b..4d2d064b32 100644 --- a/test/SemaCXX/vector.cpp +++ b/test/SemaCXX/vector.cpp @@ -267,3 +267,14 @@ void test_mixed_vector_types(fltx4 f, intx4 n, flte4 g, flte4 m) { (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); +} |