]> granicus.if.org Git - clang/commitdiff
objective-c: reverse patch for // rdar://9818354
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 1 Aug 2011 22:39:49 +0000 (22:39 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 1 Aug 2011 22:39:49 +0000 (22:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136658 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaObjCProperty.cpp
test/ARCMT/remove-dealloc-zerouts.m
test/ARCMT/remove-dealloc-zerouts.m.result
test/SemaObjC/arc.m
test/SemaObjC/atomoic-property-synnthesis-rules.m
test/SemaObjC/conflict-nonfragile-abi2.m
test/SemaObjC/default-synthesize.m
test/SemaObjC/property-ns-returns-not-retained-attr.m
test/SemaObjC/provisional-ivar-lookup.m
test/SemaObjC/synth-provisional-ivars.m

index cd27636fca71e458ebbe4fcfdfa29e5effe52946..7a79c5b27c904b8b6d75601766baab1f5787904a 100644 (file)
@@ -472,10 +472,6 @@ def err_continuation_class : Error<"continuation class has no primary class">;
 def err_property_type : Error<"property cannot have array or function type %0">;
 def error_missing_property_context : Error<
   "missing context for property implementation declaration">;
-def error_property_after_method_impl : Error<
-  "property implementation declaration after method or function definition">;
-def warn_property_after_method_impl : Warning<
-  "property implementation declaration after method or function definition">;
 def error_bad_property_decl : Error<
   "property implementation must have its declaration in interface %0">;
 def error_category_property : Error<
index 8c8af1389b9b301317af4c364f5e54850bc4f58e..160a3fa4e8c08ee64895e5fc64ba6544a595d792 100644 (file)
@@ -555,14 +555,6 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
         return 0;
       }
     }
-    if ((IC->meth_begin() != IC->meth_end()) && AtLoc.isValid()) {
-      if (getLangOptions().ObjCAutoRefCount)
-        Diag(AtLoc, diag::error_property_after_method_impl);
-      else
-        Diag(AtLoc, diag::warn_property_after_method_impl);
-      ObjCMethodDecl *method = *(IC->meth_begin());
-      Diag(method->getLocation(), diag::note_method_declared_at);
-    }
   } else if ((CatImplClass = dyn_cast<ObjCCategoryImplDecl>(ClassImpDecl))) {
     if (Synthesize) {
       Diag(AtLoc, diag::error_synthesize_category_decl);
index 40e99206ffe117b64eb643d36ddd7218297e824e..3ba85f1edcab4cf3d88f9cb005e6fef196ae3670 100644 (file)
 @end
 
 @implementation Bar
-@synthesize a;
 - (void) dealloc {
   [self setA:0];  // This is user-defined setter overriding synthesize, don't touch it.
   self.a.x = 0;  // every dealloc must zero out its own ivar. This patter is not recognized.
 }
+@synthesize a;
 - (void) setA:(Foo*) val { }
 - (id) a {return 0;}
 @end
index 0487fdcd2e4d0c191d623317d54fe20b7a12f57b..dc6ffd311490dfa0cafe65be81714331fbfa3cfa 100644 (file)
 @end
 
 @implementation Bar
-@synthesize a;
 - (void) dealloc {
   [self setA:0];  // This is user-defined setter overriding synthesize, don't touch it.
   self.a.x = 0;  // every dealloc must zero out its own ivar. This patter is not recognized.
 }
+@synthesize a;
 - (void) setA:(Foo*) val { }
 - (id) a {return 0;}
 @end
index 824fc08aec5c6c2cf0feee517f01c1f6930b7dbb..88d08181f602c16b14d7779c6e5146b93f461d61 100644 (file)
@@ -614,9 +614,9 @@ int Test33(id someid) {
 @synthesize newName;
 
 @synthesize newName1;
-- (id) newName1 { return 0; } // expected-note {{method declared here}}
+- (id) newName1 { return 0; }
 
-@synthesize newName2; // expected-error {{property implementation declaration after method or function definition}}
+@synthesize newName2;
 @end
 
 void test35(void) {
index 80c693d12f31010aa49004fa46c738da16a3ca97..af790e3159ada6fa39db3739c9765259105b29ed 100644 (file)
@@ -1,5 +1,4 @@
 // RUN: %clang_cc1  -fsyntax-only -verify %s
-// XFAIL: *
 
 /*
   Conditions for warning:
index a5051304ebcf57c9467164a2266c85f98d855b6b..5d6b2810fc10505999637a12f59d12a11fb0bb47 100644 (file)
@@ -15,13 +15,8 @@ int glob;
 // rdar://9027673
 // Warning on future name lookup rule is removed.
 @implementation I
-@synthesize glob;
-@dynamic p;
-@dynamic le;
-@dynamic l;
-@dynamic ls;
-@dynamic r;
 - (int) Meth { return glob; } // no warning
+@synthesize glob;
 // rdar://8248681
 - (int) Meth1: (int) p {
   extern int le;
@@ -31,6 +26,11 @@ int glob;
   p = le + ls + r;
   return l;
 }
+@dynamic p;
+@dynamic le;
+@dynamic l;
+@dynamic ls;
+@dynamic r;
 @end
 
 
index 0f9b96aeaeaf087cdfa5e7390c7266ceb95d4658..33e3bd6f346458a3295052c4dd413ac1cc354d48 100644 (file)
 @end
 
 @implementation D
-@synthesize PROP=IVAR;
 - (int) Meth { return self.PROP; }
+@synthesize PROP=IVAR;
 @end
 
index 4968f268ddfafd432df0934cbff88f535f0cd129..187c93f3d3af81d9e2b8f6d3df21895fbf948491 100644 (file)
@@ -15,7 +15,7 @@
 @synthesize newName;
 
 @synthesize newName1;
-@synthesize newName2;
 - (id) newName1 { return 0; }
 
+@synthesize newName2;
 @end
index df9092bf1eae32c0ceb651f593330d1d69d1d8b3..04d6a41930955448628d497841f273369f732b0a 100644 (file)
@@ -15,7 +15,7 @@
 @synthesize foo = _foo;
 @synthesize foo1;
 
-- (void)setFoo:(int)value { // expected-note 3 {{method declared here}}
+- (void)setFoo:(int)value {
     _foo = foo; // expected-error {{use of undeclared identifier 'foo'}}
 }
 
     _foo = foo3;       // OK
 }
 
-@synthesize foo2 = _foo2; // expected-warning {{property implementation declaration after method or function definition}}
-@synthesize foo3; // expected-warning {{property implementation declaration after method or function definition}}
+@synthesize foo2 = _foo2;
+@synthesize foo3;
 
-@synthesize PROP=PROP; // expected-warning {{property implementation declaration after method or function definition}}
+@synthesize PROP=PROP;
 - (void)setPROP:(int)value {
     PROP = PROP;        // OK
 }
index 1d44a0bfd2bebaf5d34dd02a33d01d5691125261..e8179aaa00ddbfb1e9d6d9a7871036fe65a6b2a7 100644 (file)
@@ -18,23 +18,22 @@ int bar;
 @end
 
 @implementation I
-- (int) Meth { return PROP; } // expected-note 2{{'PROP' declared here}} \
-                              // expected-note 5{{method declared here}}
+- (int) Meth { return PROP; } // expected-note 2{{'PROP' declared here}}
 
-@dynamic PROP1; // expected-warning {{property implementation declaration after method or function definition}}
+@dynamic PROP1;
 - (int) Meth1 { return PROP1; }  // expected-error {{use of undeclared identifier 'PROP1'}}
 
 - (int) Meth2 { return PROP2; }  // expected-error {{use of undeclared identifier 'PROP2'}}
-@dynamic PROP2; // expected-warning {{property implementation declaration after method or function definition}}
+@dynamic PROP2;
 
 - (int) Meth3 { return PROP3; }  // expected-error {{use of undeclared identifier 'PROP3'}}
-@synthesize PROP3=IVAR; // expected-warning {{property implementation declaration after method or function definition}}
+@synthesize PROP3=IVAR;
 
 - (int) Meth4 { return PROP4; }
-@synthesize PROP4=PROP4; // expected-warning {{property implementation declaration after method or function definition}}
+@synthesize PROP4=PROP4;
 
 - (int) Meth5 { return bar; }  // expected-error {{use of undeclared identifier 'bar'}}
-@synthesize bar = _bar; // expected-warning {{property implementation declaration after method or function definition}}
+@synthesize bar = _bar;
 
 - (int) Meth6 { return bar1; }