You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2020. It is now read-only.
Copy file name to clipboardExpand all lines: test/Sema/objc-bool-constant-conversion.m
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -12,27 +12,27 @@ int main() {
12
12
B =YES;
13
13
B =NO;
14
14
15
-
B = -1;// expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}}
16
-
B =0 -1;// expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}}
17
-
B =YES +YES;// expected-warning {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}}
15
+
B = -1;// expected-warning{{implicit conversion from constant value -1 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
16
+
B =0 -1;// expected-warning{{implicit conversion from constant value -1 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
17
+
B =YES +YES;// expected-warning {{implicit conversion from constant value 2 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
18
18
B =YES |YES;
19
19
20
-
B = B ?2 :2;// expected-warning 2 {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}}
20
+
B = B ?2 :2;// expected-warning 2 {{implicit conversion from constant value 2 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
21
21
22
-
BOOL Init = -1;// expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}}
23
-
BOOL Init2 = B ?2 :2;// expected-warning 2 {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}}
22
+
BOOL Init = -1;// expected-warning{{implicit conversion from constant value -1 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
23
+
BOOL Init2 = B ?2 :2;// expected-warning 2 {{implicit conversion from constant value 2 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
24
24
25
25
voidtakesbool(BOOL);
26
-
takesbool(43);// expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}}
26
+
takesbool(43);// expected-warning {{implicit conversion from constant value 43 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
27
27
28
-
BOOL OutOfRange =400;// expected-warning{{implicit conversion from constant value 400 to BOOL; the only well defined values for BOOL are YES and NO}}
28
+
BOOL OutOfRange =400;// expected-warning{{implicit conversion from constant value 400 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
29
29
}
30
30
31
31
@interfaceBoolProp
32
32
@propertyBOOL b;
33
33
@end
34
34
35
35
voidf(BoolProp *bp) {
36
-
bp.b =43;// expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}}
37
-
[bpsetB:43];// expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}}
36
+
bp.b =43;// expected-warning {{implicit conversion from constant value 43 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
37
+
[bpsetB:43];// expected-warning {{implicit conversion from constant value 43 to'BOOL'; the only well defined values for'BOOL' are YES and NO}}
Copy file name to clipboardExpand all lines: test/Sema/tautological-objc-bool-compare.m
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,16 @@
9
9
voidtest() {
10
10
int r;
11
11
r = B >0;
12
-
r = B >1;// expected-warning {{result of comparison of constant 1 with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
12
+
r = B >1;// expected-warning {{result of comparison of constant 1 with expression of type'BOOL' is always false, as the only well defined values for'BOOL' are YES and NO}}
13
13
r = B <1;
14
-
r = B <0;// expected-warning {{result of comparison of constant 0 with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
15
-
r = B >=0;// expected-warning {{result of comparison of constant 0 with expression of type BOOL is always true, as the only well defined values for BOOL are YES and NO}}
14
+
r = B <0;// expected-warning {{result of comparison of constant 0 with expression of type'BOOL' is always false, as the only well defined values for'BOOL' are YES and NO}}
15
+
r = B >=0;// expected-warning {{result of comparison of constant 0 with expression of type'BOOL' is always true, as the only well defined values for'BOOL' are YES and NO}}
16
16
r = B <=0;
17
17
18
-
r = B >YES;// expected-warning {{result of comparison of constant YES with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
18
+
r = B >YES;// expected-warning {{result of comparison of constant YES with expression of type'BOOL' is always false, as the only well defined values for'BOOL' are YES and NO}}
19
19
r = B >NO;
20
-
r = B <NO;// expected-warning {{result of comparison of constant NO with expression of type BOOL is always false, as the only well defined values for BOOL are YES and NO}}
20
+
r = B <NO;// expected-warning {{result of comparison of constant NO with expression of type'BOOL' is always false, as the only well defined values for'BOOL' are YES and NO}}
21
21
r = B <YES;
22
-
r = B >=NO;// expected-warning {{result of comparison of constant NO with expression of type BOOL is always true, as the only well defined values for BOOL are YES and NO}}
22
+
r = B >=NO;// expected-warning {{result of comparison of constant NO with expression of type'BOOL' is always true, as the only well defined values for'BOOL' are YES and NO}}