From e64941280877d065a27e8cefd2a9038256d0e3ac Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 11 Aug 2009 18:49:54 +0000 Subject: ir-gen support for anonymous union data member copying in copy constructors and used in default constructor's initializer list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78700 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenModule.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 59f44de26a..a642de9a46 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -699,14 +699,14 @@ void CodeGenModule::DeferredCopyConstructorToEmit(GlobalDecl CopyCtorDecl) { for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(), FieldEnd = ClassDecl->field_end(); Field != FieldEnd; ++Field) { - assert(!(*Field)->isAnonymousStructOrUnion() && - "FIXME. Anonymous union NYI - DeferredCopyConstructorToEmit"); QualType FieldType = Context.getCanonicalType((*Field)->getType()); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) FieldType = Array->getElementType(); if (const RecordType *FieldClassType = FieldType->getAs()) { + if ((*Field)->isAnonymousStructOrUnion()) + continue; CXXRecordDecl *FieldClassDecl - = cast(FieldClassType->getDecl()); + = cast(FieldClassType->getDecl()); if (CXXConstructorDecl *FieldCopyCtor = FieldClassDecl->getCopyConstructor(Context, 0)) GetAddrOfCXXConstructor(FieldCopyCtor, Ctor_Complete); -- cgit v1.2.3-18-g5258