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

llvm-svn: 163514
This commit is contained in:
Douglas Gregor 2012-09-10 14:57:06 +00:00
parent 02f481c42f
commit c5c5734d19
2 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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);
}