aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-07-23 23:49:00 +0000
committerDouglas Gregor <dgregor@apple.com>2009-07-23 23:49:00 +0000
commit5e03f9ea8174ae588c5e69ec6b5ef4c68f8fd766 (patch)
treec28c5e0be4aa5ba6ea746eda3c255afee997abdd /lib/Sema/SemaDecl.cpp
parent70ee975fad4653fa09f8e77f9a46a7b1f592ef59 (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.cpp9
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());