diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-23 23:49:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-23 23:49:00 +0000 |
commit | 5e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766 (patch) | |
tree | c28c5e0be4aa5ba6ea746eda3c255afee997abdd /lib/Sema/SemaDecl.cpp | |
parent | 70ee975fad4653fa09f8e77f9a46a7b1f592ef59 (diff) |
This patch fixes the implementations of the __has_trivial_destructor
and __has_trivial_constructor builtin pseudo-functions and
additionally implements __has_trivial_copy and __has_trivial_assign,
from John McCall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 0211470c76..2ecefde538 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4244,9 +4244,7 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T, } if (getLangOptions().CPlusPlus) { - QualType EltTy = T; - while (const ArrayType *AT = Context.getAsArrayType(EltTy)) - EltTy = AT->getElementType(); + QualType EltTy = Context.getBaseElementType(T); if (const RecordType *RT = EltTy->getAsRecordType()) { CXXRecordDecl* RDecl = cast<CXXRecordDecl>(RT->getDecl()); @@ -4430,10 +4428,7 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) { typedef RecordDecl::field_iterator field_iter; for (field_iter fi = RD->field_begin(), fe = RD->field_end(); fi != fe; ++fi) { - QualType EltTy = (*fi)->getType(); - while (const ArrayType *AT = Context.getAsArrayType(EltTy)) - EltTy = AT->getElementType(); - + QualType EltTy = Context.getBaseElementType((*fi)->getType()); if (const RecordType *EltRT = EltTy->getAsRecordType()) { CXXRecordDecl* EltRD = cast<CXXRecordDecl>(EltRT->getDecl()); |