From c5f18f3e8c3f1e9cb25534f9a9676f112bedc2a7 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 17 May 2011 02:17:52 +0000 Subject: [PATCH] Revert r131447, see if it fixes the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131450 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/TargetInfo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 3c18b0b108..bc2472cebb 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -128,9 +128,12 @@ static bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays) { if (RD->hasFlexibleArrayMember()) return false; - // If this is a C++ record, check if it is empty. + // If this is a C++ record, check the bases first. if (const CXXRecordDecl *CXXRD = dyn_cast(RD)) - return CXXRD->isEmpty(); + for (CXXRecordDecl::base_class_const_iterator i = CXXRD->bases_begin(), + e = CXXRD->bases_end(); i != e; ++i) + if (!isEmptyRecord(Context, i->getType(), true)) + return false; for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) -- 2.50.1