]> granicus.if.org Git - clang/commitdiff
Change to warning when property uses an ivar in super class
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 29 Apr 2009 23:31:56 +0000 (23:31 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 29 Apr 2009 23:31:56 +0000 (23:31 +0000)
in an @synthesize diective, as it breaks few projects.

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

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/ivar-sem-check-2.m

index 098bbd4e68e93e8b4f6ad77a849c6e2051d1139e..bf70de99ebd3508aae79d256e99ef123fc86ee9b 100644 (file)
@@ -220,8 +220,8 @@ def error_synthesized_ivar_yet_not_supported : Error<
 
 def error_property_ivar_type : Error<
   "type of property %0 does not match type of ivar %1">;
-def error_ivar_in_superclass_use : Error<
-  "property %0 attempting to use ivar %1 declared in in super class %2">;
+def warn_ivar_in_superclass_use : Warning<
+  "property %0 attempting to use ivar %1 declared in super class %2">;
 def error_weak_property : Error<
   "existing ivar %1 for __weak property %0 must be __weak">;
 def error_strong_property : Error<
index 7eea4ff93e1bc436ffcd187ba9918b497b88dd9d..170efec5f37f412dbc253a8b63fe7334579eaea6 100644 (file)
@@ -1914,7 +1914,7 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
     }
     else if (getLangOptions().ObjCNonFragileABI &&
              ClassDeclared != IDecl) {
-      Diag(PropertyLoc, diag::error_ivar_in_superclass_use)
+      Diag(PropertyLoc, diag::warn_ivar_in_superclass_use)
         << property->getDeclName() << Ivar->getDeclName() 
         << ClassDeclared->getDeclName();
       Diag(Ivar->getLocation(), diag::note_previous_access_declaration)
index 6a703b24f3c5806899b341c6b821d14665124296..e14a80ffa44a34ee7617ce40b67cc5419d9669ce 100644 (file)
@@ -17,7 +17,7 @@
 @implementation Sub
 @synthesize value; // expected-note {{previous use is here}}
 @synthesize value1=value; // expected-error {{synthesized properties 'value1' and 'value' both claim ivar 'value'}} 
-@synthesize prop=value2;  // expected-error {{property 'prop' attempting to use ivar 'value2' declared in in super class 'Super'}}
+@synthesize prop=value2;  // expected-warning {{property 'prop' attempting to use ivar 'value2' declared in super class 'Super'}}
 @end