From b2197042b8bbed9287957d4c21dbe8f53deb6007 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. llvm-svn: 78700 --- clang/lib/CodeGen/CodeGenModule.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 59f44de..a642de9 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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.1