From c75e14370942b51b4cebef24fd82a9a0a61352c2 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Tue, 14 Jul 2009 18:56:31 +0000 Subject: [PATCH] Support data members of array type in default ctor-initializer AST build. llvm-svn: 75662 --- clang/lib/AST/DeclCXX.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 70c7a1bd5053..26a9c8918880 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -540,8 +540,10 @@ CXXConstructorDecl::setBaseOrMemberInitializers( } } if (i == NumInitializers) { - // FIXME. What do we do with arrays? QualType FieldType = C.getCanonicalType((*Field)->getType()); + while (const ArrayType *AT = C.getAsArrayType(FieldType)) + FieldType = AT->getElementType(); + if (FieldType->getAsRecordType()) { CXXBaseOrMemberInitializer *Member = new CXXBaseOrMemberInitializer((*Field), 0, 0, SourceLocation());