]> granicus.if.org Git - clang/commitdiff
objc: after issuing the warning on direct use of __attribute__((NSObject))
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 16 Dec 2011 15:54:29 +0000 (15:54 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 16 Dec 2011 15:54:29 +0000 (15:54 +0000)
on properties, prevent consequential error  diagnostics. // rdar://10591336

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146737 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/nsobject-attribute.m

index 63714fdfa75566d345a71aa761fc5c152eef0720..1626bf14b604e1788f07ee20ed2ca27fed0269d9 100644 (file)
@@ -1753,10 +1753,8 @@ static void handleObjCNSObject(Sema &S, Decl *D, const AttributeList &Attr) {
       return;
     }
   }
-  else {
+  else 
     S.Diag(D->getLocation(), diag::warn_nsobject_attribute);
-    return;
-  }
   D->addAttr(::new (S.Context) ObjCNSObjectAttr(Attr.getRange(), S.Context));
 }
 
index 99f332de0ab62b660865471fe26cf5ea9eca9dc2..46e84d207cb06ec8a75c413609eb07ccdd239d08 100644 (file)
@@ -45,8 +45,7 @@ int main(int argc, char *argv[]) {
 {
    __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
 }
-@property (nonatomic, retain) __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}} \
-                                // expected-error {{property with 'retain (or strong)' attribute must be of object type}}
+@property (nonatomic, retain) __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
 @end
 void test_10453342() {
     char* __attribute__((NSObject)) string2 = 0; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}