summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/self-init.m2
-rw-r--r--clang/test/SemaCXX/warn-assignment-condition.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/Analysis/self-init.m b/clang/test/Analysis/self-init.m
index 1e16e41d7a9..1dc5aa92f9c 100644
--- a/clang/test/Analysis/self-init.m
+++ b/clang/test/Analysis/self-init.m
@@ -135,7 +135,7 @@ extern void *somePtr;
}
-(id)init13 {
- if ((self == [super init])) {
+ if (self == [super init]) {
myivar = 0; // expected-warning {{Instance variable used}}
}
return self; // expected-warning {{Returning 'self'}}
diff --git a/clang/test/SemaCXX/warn-assignment-condition.cpp b/clang/test/SemaCXX/warn-assignment-condition.cpp
index 9dcffbfe84e..48cc137dac7 100644
--- a/clang/test/SemaCXX/warn-assignment-condition.cpp
+++ b/clang/test/SemaCXX/warn-assignment-condition.cpp
@@ -105,4 +105,8 @@ void test() {
if (a |= b) {} // expected-warning {{using the result of an assignment as a condition without parentheses}} \
// expected-note{{use '!=' to turn this compound assignment into an inequality comparison}} \
// expected-note{{place parentheses around the assignment to silence this warning}}
+
+ if ((x == 5)) {} // expected-warning {{equality comparison with extraneous parentheses}} \
+ // expected-note {{use '=' to turn this equality comparison into an assignment}} \
+ // expected-note {{remove extraneous parentheses around the comparison to silence this warning}}
}
OpenPOWER on IntegriCloud