[cfe-dev] Initializer assertion failure

Sanghyeon Seo sanxiyn at gmail.com
Fri Dec 14 01:11:28 PST 2007


2007/12/14, Oliver Hunt <oliver at apple.com>:
> The problem is that the inner ILE (eg. { 0x00aa, ...} ) is
> initialised to void, and the correct type is never set.

This seems to do the job for this specific case, but I know it isn't a
complete solution. In the mean time, you can use it to find other
failures.

Index: Sema/SemaDecl.cpp
===================================================================
--- Sema/SemaDecl.cpp	(revision 45029)
+++ Sema/SemaDecl.cpp	(working copy)
@@ -444,6 +444,8 @@
           int maxElements = CAT->getMaximumElements();
           CheckConstantInitList(DeclType, InitList, ElementType, isStatic,
                                 maxElements, hadError);
+        } else if (DeclType->isRecordType()) {
+          expr->setType(DeclType);
         }
       } else {
         hadError = CheckInitExpr(expr, IList, i, isStatic, ElementType);

-- 
Seo Sanghyeon



More information about the cfe-dev mailing list