diff options
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 14 | ||||
-rw-r--r-- | test/CodeGenObjC/property-setter-attr.m | 10 |
2 files changed, 17 insertions, 7 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index 293fe257cc..bb85536cd4 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -327,13 +327,13 @@ void Parser::ParseObjCInterfaceDeclList(DeclTy *interfaceDecl, Selector GetterSel = PP.getSelectorTable().getNullarySelector(SelName); IdentifierInfo *SetterName = OCDS.getSetterName(); - if (!SetterName) - SetterName = FD.D.getIdentifier(); - - Selector SetterSel = - SelectorTable::constructSetterName(PP.getIdentifierTable(), - PP.getSelectorTable(), - SetterName); + Selector SetterSel; + if (SetterName) + SetterSel = PP.getSelectorTable().getSelector(1, &SetterName); + else + SetterSel = SelectorTable::constructSetterName(PP.getIdentifierTable(), + PP.getSelectorTable(), + FD.D.getIdentifier()); bool isOverridingProperty = false; DeclTy *Property = Actions.ActOnProperty(CurScope, AtLoc, FD, OCDS, GetterSel, SetterSel, diff --git a/test/CodeGenObjC/property-setter-attr.m b/test/CodeGenObjC/property-setter-attr.m new file mode 100644 index 0000000000..edc80554cd --- /dev/null +++ b/test/CodeGenObjC/property-setter-attr.m @@ -0,0 +1,10 @@ +// RUN: clang -emit-llvm -triple=i686-apple-darwin8 -o %t %s +// RUN: grep -e "SiSetOtherThings:" %t + +@interface A +@property(setter=iSetOtherThings:) int otherThings; +@end + +@implementation A +@dynamic otherThings; +@end |