Hi rjmccall,

Fixes

struct A {
  ~A();
};

struct B {
  A a;
};

struct C {
  union {
    B b;
  };

  ~C() noexcept;
};

C::~C() noexcept {}

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10508

Files:
  lib/CodeGen/CGClass.cpp

Index: lib/CodeGen/CGClass.cpp
===================================================================
--- lib/CodeGen/CGClass.cpp
+++ lib/CodeGen/CGClass.cpp
@@ -1293,6 +1293,9 @@
                          const CXXRecordDecl *BaseClassDecl,
                          const CXXRecordDecl *MostDerivedClassDecl)
 {
+  if (!BaseClassDecl->hasSimpleDestructor())
+    return false;
+
   // If the destructor is trivial we don't have to check anything else.
   if (BaseClassDecl->hasTrivialDestructor())
     return true;

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
Index: lib/CodeGen/CGClass.cpp
===================================================================
--- lib/CodeGen/CGClass.cpp
+++ lib/CodeGen/CGClass.cpp
@@ -1293,6 +1293,9 @@
                          const CXXRecordDecl *BaseClassDecl,
                          const CXXRecordDecl *MostDerivedClassDecl)
 {
+  if (!BaseClassDecl->hasSimpleDestructor())
+    return false;
+
   // If the destructor is trivial we don't have to check anything else.
   if (BaseClassDecl->hasTrivialDestructor())
     return true;
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to