Richard Smith aa6ce34141 Fix tracking of whether a destructor would be deleted.
I've been unable to find any cases whose behavior is actually changed by this,
but only because an implicitly deleted destructor also results in it being
impossible to have a trivial (non-deleted) copy constructor, which the place
where this really matters (choosing whether to pass a class in registers)
happens to also check.

llvm-svn: 313948
2017-09-22 01:04:22 +00:00

22 lines
587 B
C++

// RUN: %clang_cc1 -std=c++11 %s -ast-dump | FileCheck %s
struct A { ~A() = delete; };
// CHECK-LABEL: CXXRecordDecl {{.*}} struct A
// CHECK: Destructor trivial user_declared
struct B : A {};
// CHECK-LABEL: CXXRecordDecl {{.*}} struct B
// CHECK: Destructor trivial needs_overload_resolution
struct C : B {};
// CHECK-LABEL: CXXRecordDecl {{.*}} struct C
// CHECK: Destructor trivial needs_overload_resolution
struct D { ~D(); };
struct E : D {};
union U {
E e;
};
// CHECK-LABEL: CXXRecordDecl {{.*}} union U
// CHECK: Destructor non_trivial needs_implicit defaulted_is_deleted