]> granicus.if.org Git - clang/commitdiff
Have Sema::CheckConstantInitList skip semantic analysis when the element type is...
authorSteve Naroff <snaroff@apple.com>
Fri, 7 Dec 2007 21:12:53 +0000 (21:12 +0000)
committerSteve Naroff <snaroff@apple.com>
Fri, 7 Dec 2007 21:12:53 +0000 (21:12 +0000)
snarofflocal% cat bug.m

#import <Foundation/NSGeometry.h>

#define NUMHELICOPTERRECTS 5

static NSRect helicopterRects[NUMHELICOPTERRECTS] = {
    {{27, 0}, {18, 11}}, // Bottom
    {{0, 8}, {4, 11}}, // Tail
    {{0, 16}, {50, 1}},
    {{22, 5}, {18, 12}}, // Body
    {{0, 10}, {42, 3}}
};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44684 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp

index 3d0add8e276c3f59b42c6b24e6b94dabff8e581d..23a4e67884f9cc55ecb664bd31ec955bb41113ec 100644 (file)
@@ -453,6 +453,9 @@ void Sema::CheckConstantInitList(QualType DeclType, InitListExpr *IList,
   int maxElementsAtThisLevel = 0;
   int nInitsAtLevel = 0;
 
+  if (ElementType->isRecordType()) // FIXME: until we support structures...
+    return;
+    
   if (const ConstantArrayType *CAT = DeclType->getAsConstantArrayType()) {
     // We have a constant array type, compute maxElements *at this level*.
     maxElementsAtThisLevel = CAT->getMaximumElements();