зеркало из https://github.com/microsoft/clang-1.git
objective-c modern translator. Don't ignore unnamed bitfields
when rewriting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152123 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
faa7fac3f8
Коммит
9a2105bc79
|
@ -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();
|
||||
|
||||
|
|
|
@ -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: };
|
Загрузка…
Ссылка в новой задаче