[cfe-commits] r70441 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclObjC.cpp test/SemaObjC/ivar-sem-check-2.m
Fariborz Jahanian
fjahanian at apple.com
Wed Apr 29 16:31:59 PDT 2009
Author: fjahanian
Date: Wed Apr 29 18:31:56 2009
New Revision: 70441
URL: http://llvm.org/viewvc/llvm-project?rev=70441&view=rev
Log:
Change to warning when property uses an ivar in super class
in an @synthesize diective, as it breaks few projects.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/ivar-sem-check-2.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=70441&r1=70440&r2=70441&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Apr 29 18:31:56 2009
@@ -220,8 +220,8 @@
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<
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=70441&r1=70440&r2=70441&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Apr 29 18:31:56 2009
@@ -1914,7 +1914,7 @@
}
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)
Modified: cfe/trunk/test/SemaObjC/ivar-sem-check-2.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/ivar-sem-check-2.m?rev=70441&r1=70440&r2=70441&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/ivar-sem-check-2.m (original)
+++ cfe/trunk/test/SemaObjC/ivar-sem-check-2.m Wed Apr 29 18:31:56 2009
@@ -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'}}
- at synthesize prop=value2; // expected-error {{property 'prop' attempting to use ivar 'value2' declared in in super class 'Super'}}
+ at synthesize prop=value2; // expected-warning {{property 'prop' attempting to use ivar 'value2' declared in super class 'Super'}}
@end
More information about the cfe-commits
mailing list