Allow vector types in pseudo-destructor expressions. Fixes PR13798.
llvm-svn: 163514
This commit is contained in:
parent
02f481c42f
commit
c5c5734d19
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue