Changed 'readonly' 'retain/copy' diagnostics into

warning as it is allowed in gcc and will break projects.

llvm-svn: 60710
This commit is contained in:
Fariborz Jahanian 2008-12-08 19:28:10 +00:00
parent 3685995d2c
commit 3edadfc730
3 changed files with 8 additions and 5 deletions

View File

@ -448,6 +448,8 @@ DIAG(err_objc_unexpected_attr, ERROR,
"prefix attribute must be followed by an interface or protocol") "prefix attribute must be followed by an interface or protocol")
DIAG(err_objc_property_attr_mutually_exclusive, ERROR, DIAG(err_objc_property_attr_mutually_exclusive, ERROR,
"property attributes '%0' and '%1' are mutually exclusive") "property attributes '%0' and '%1' are mutually exclusive")
DIAG(warn_objc_property_attr_mutually_exclusive, WARNING,
"property attributes '%0' and '%1' are mutually exclusive")
DIAG(warn_objc_property_no_assignment_attribute, WARNING, DIAG(warn_objc_property_no_assignment_attribute, WARNING,
"no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed") "no 'assign', 'retain', or 'copy' attribute is specified - 'assign' is assumed")
DIAG(warn_objc_property_default_assign_on_object, WARNING, DIAG(warn_objc_property_default_assign_on_object, WARNING,

View File

@ -1299,9 +1299,10 @@ void Sema::CheckObjCPropertyAttributes(QualType PropertyTy,
(Attributes & ObjCDeclSpec::DQ_PR_copy) ? (Attributes & ObjCDeclSpec::DQ_PR_copy) ?
"copy" : "retain"; "copy" : "retain";
Diag(Loc, diag::err_objc_property_attr_mutually_exclusive) Diag(Loc, (Attributes & (ObjCDeclSpec::DQ_PR_readwrite)) ?
diag::err_objc_property_attr_mutually_exclusive :
diag::warn_objc_property_attr_mutually_exclusive)
<< "readonly" << which; << "readonly" << which;
return;
} }
// Check for copy or retain on non-object types. // Check for copy or retain on non-object types.

View File

@ -1,15 +1,15 @@
// RUN: clang -fsyntax-only -verify %s // RUN: clang -fsyntax-only -verify %s
@protocol P0 @protocol P0
@property(readonly,assign) id X; // expected-error {{property attributes 'readonly' and 'assign' are mutually exclusive}} @property(readonly,assign) id X; // expected-warning {{property attributes 'readonly' and 'assign' are mutually exclusive}}
@end @end
@protocol P1 @protocol P1
@property(readonly,retain) id X; // expected-error {{property attributes 'readonly' and 'retain' are mutually exclusive}} @property(readonly,retain) id X; // expected-warning {{property attributes 'readonly' and 'retain' are mutually exclusive}}
@end @end
@protocol P2 @protocol P2
@property(readonly,copy) id X; // expected-error {{property attributes 'readonly' and 'copy' are mutually exclusive}} @property(readonly,copy) id X; // expected-warning {{property attributes 'readonly' and 'copy' are mutually exclusive}}
@end @end
@protocol P3 @protocol P3