objective-c modern translator. Don't ignore unnamed bitfields

when rewriting.

llvm-svn: 152123
This commit is contained in:
Fariborz Jahanian 2012-03-06 17:16:27 +00:00
parent ef21be2cda
commit d7a3261dfb
2 changed files with 25 additions and 5 deletions

View File

@ -3250,12 +3250,9 @@ void RewriteModernObjC::RewriteObjCInternalStruct(ObjCInterfaceDecl *CDecl,
ObjCInterfaceDecl *RCDecl = CDecl->getSuperClass();
SmallVector<ObjCIvarDecl *, 8> IVars;
for (ObjCIvarDecl *IVD = CDecl->all_declared_ivar_begin();
IVD; IVD = IVD->getNextIvar()) {
// Ignore unnamed bit-fields.
if (!IVD->getDeclName())
continue;
IVD; IVD = IVD->getNextIvar())
IVars.push_back(IVD);
}
SourceLocation LocStart = CDecl->getLocStart();
SourceLocation LocEnd = CDecl->getEndOfDefinitionLoc();

View File

@ -0,0 +1,23 @@
// RUN: %clang_cc1 -E %s -o %t.mm
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
@interface Foo {
@private
int first;
int :1;
int third :1;
int :1;
int fifth :1;
}
@end
@implementation Foo
@end
// CHECK: struct Foo_IMPL {
// CHECK-NEXT: int first;
// CHECK-NEXT: int : 1;
// CHECK-NEXT: int third : 1;
// CHECK-NEXT: int : 1;
// CHECK-NEXT: int fifth : 1;
// CHECK-NEXT: char : 0;
// CHECK-NEXT: };