[cfe-commits] r163514 - in /cfe/trunk: lib/Sema/SemaExprCXX.cpp test/SemaCXX/vector.cpp

Douglas Gregor dgregor at apple.com
Mon Sep 10 07:57:06 PDT 2012


Author: dgregor
Date: Mon Sep 10 09:57:06 2012
New Revision: 163514

URL: http://llvm.org/viewvc/llvm-project?rev=163514&view=rev
Log:
Allow vector types in pseudo-destructor expressions. Fixes PR13798.

Modified:
    cfe/trunk/lib/Sema/SemaExprCXX.cpp
    cfe/trunk/test/SemaCXX/vector.cpp

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=163514&r1=163513&r2=163514&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Mon Sep 10 09:57:06 2012
@@ -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

Modified: cfe/trunk/test/SemaCXX/vector.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/vector.cpp?rev=163514&r1=163513&r2=163514&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/vector.cpp (original)
+++ cfe/trunk/test/SemaCXX/vector.cpp Mon Sep 10 09:57:06 2012
@@ -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);
+}





More information about the cfe-commits mailing list