summaryrefslogtreecommitdiff
path: root/test/SemaObjC/idiomatic-parentheses.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/idiomatic-parentheses.m')
-rw-r--r--test/SemaObjC/idiomatic-parentheses.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaObjC/idiomatic-parentheses.m b/test/SemaObjC/idiomatic-parentheses.m
index 417b948b8fabe..801db5944f10f 100644
--- a/test/SemaObjC/idiomatic-parentheses.m
+++ b/test/SemaObjC/idiomatic-parentheses.m
@@ -4,13 +4,18 @@
// <rdar://problem/7382435>
@interface Object
+{
+ unsigned uid;
+}
- (id) init;
- (id) initWithInt: (int) i;
- (void) iterate: (id) coll;
- (id) nextObject;
+@property unsigned uid;
@end
@implementation Object
+@synthesize uid;
- (id) init {
if (self = [self init]) {
}
@@ -20,6 +25,12 @@
- (id) initWithInt: (int) i {
if (self = [self initWithInt: i]) {
}
+ // rdar://11066598
+ if (self.uid = 100) { // expected-warning {{using the result of an assignment as a condition without parentheses}} \
+ // expected-note {{place parentheses around the assignment to silence this warning}} \
+ // expected-note {{use '==' to turn this assignment into an equality comparison}}
+ // ...
+ }
return self;
}