diff options
author | John McCall <rjmccall@apple.com> | 2011-02-13 00:46:43 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-02-13 00:46:43 +0000 |
commit | 0d70d71ccbc4f7f59cadb759f61b7172a149676c (patch) | |
tree | 027a6fb58fc309c2111963092aef4742f3cdf731 /lib/AST/Type.cpp | |
parent | e3c8c64e7735c3589e1a34e6000c93183a55920c (diff) |
Look through array types when deciding whether a field requires non-trivial
destruction in the destructor-aliases logic. Fixes PR 9197.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125447 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Type.cpp')
-rw-r--r-- | lib/AST/Type.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 36d501577c..0130b13b94 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -1576,3 +1576,14 @@ bool Type::hasSizedVLAType() const { return false; } + +QualType::DestructionKind QualType::isDestructedTypeImpl(QualType type) { + /// Currently, the only destruction kind we recognize is C++ objects + /// with non-trivial destructors. + const CXXRecordDecl *record = + type->getBaseElementTypeUnsafe()->getAsCXXRecordDecl(); + if (record && !record->hasTrivialDestructor()) + return DK_cxx_destructor; + + return DK_none; +} |