forked from OSchip/llvm-project
Fix invalid error about duplicate declaration of padding bit field in
an interface. llvm-svn: 70652
This commit is contained in:
parent
3e3e69bbe7
commit
bdb23a1f56
|
@ -3980,12 +3980,14 @@ void Sema::ActOnFields(Scope* S,
|
|||
for (ObjCInterfaceDecl::ivar_iterator IVI = ID->ivar_begin(),
|
||||
IVE = ID->ivar_end(); IVI != IVE; ++IVI) {
|
||||
ObjCIvarDecl* Ivar = (*IVI);
|
||||
IdentifierInfo *II = Ivar->getIdentifier();
|
||||
ObjCIvarDecl* prevIvar =
|
||||
ID->getSuperClass()->lookupInstanceVariable(Context, II);
|
||||
if (prevIvar) {
|
||||
Diag(Ivar->getLocation(), diag::err_duplicate_member) << II;
|
||||
Diag(prevIvar->getLocation(), diag::note_previous_declaration);
|
||||
|
||||
if (IdentifierInfo *II = Ivar->getIdentifier()) {
|
||||
ObjCIvarDecl* prevIvar =
|
||||
ID->getSuperClass()->lookupInstanceVariable(Context, II);
|
||||
if (prevIvar) {
|
||||
Diag(Ivar->getLocation(), diag::err_duplicate_member) << II;
|
||||
Diag(prevIvar->getLocation(), diag::note_previous_declaration);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
@interface B1 {
|
||||
@public
|
||||
double fill_B; // expected-note {{previous declaration is here}}
|
||||
unsigned : 0;
|
||||
}
|
||||
@end
|
||||
|
||||
|
@ -10,6 +11,7 @@
|
|||
@public
|
||||
int one; // expected-note {{previous declaration is here}}
|
||||
int one; // expected-error {{duplicate member 'one'}}
|
||||
unsigned : 0;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue