diff options
author | Steve Naroff <snaroff@apple.com> | 2007-12-07 21:12:53 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2007-12-07 21:12:53 +0000 |
commit | 32c3904156d11e03cb59dcaf695d85b4be664bbd (patch) | |
tree | c4a0efa70a60e80787beb262674d1ca0dcf8e3ca | |
parent | 9feba0289158b361577df39063025c43c7cc8bfb (diff) |
Have Sema::CheckConstantInitList skip semantic analysis when the element type is a record (until we implement the FIXME). This removes a bogus error for the following code...
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
-rw-r--r-- | Sema/SemaDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 3d0add8e27..23a4e67884 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -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(); |