Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Mar 28, 2020. It is now read-only.
/swift-clangPublic archive

Commit3520198

Browse files
committed
Use 'BOOL' instead of BOOL in diagnostic messages
Type names should be enclosed in single quotes.git-svn-id:https://llvm.org/svn/llvm-project/cfe/trunk@372152 91177308-0d34-0410-b5e6-96231b3b80d8
1 parentefdc96a commit3520198

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

‎include/clang/Basic/DiagnosticSemaKinds.td‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,8 +3254,8 @@ def warn_impcast_bitfield_precision_constant : Warning<
32543254
"implicit truncation from %2 to bit-field changes value from %0 to %1">,
32553255
InGroup<BitFieldConstantConversion>;
32563256
def warn_impcast_constant_int_to_objc_bool : Warning<
3257-
"implicit conversion from constant value %0 to BOOL; "
3258-
"the only well defined values for BOOL are YES and NO">,
3257+
"implicit conversion from constant value %0 to'BOOL'; "
3258+
"the only well defined values for'BOOL' are YES and NO">,
32593259
InGroup<ObjCBoolConstantConversion>;
32603260

32613261
def warn_impcast_fixed_point_range : Warning<
@@ -6100,8 +6100,8 @@ def warn_tautological_constant_compare : Warning<
61006100
"%select{%1|%3}0 is always %4">,
61016101
InGroup<TautologicalTypeLimitCompare>, DefaultIgnore;
61026102
def warn_tautological_compare_objc_bool : Warning<
6103-
"result of comparison of constant %0 with expression of type BOOL"
6104-
" is always %1, as the only well defined values for BOOL are YES and NO">,
6103+
"result of comparison of constant %0 with expression of type'BOOL'"
6104+
" is always %1, as the only well defined values for'BOOL' are YES and NO">,
61056105
InGroup<TautologicalObjCBoolCompare>;
61066106

61076107
def warn_mixed_sign_comparison : Warning<

‎test/Sema/objc-bool-constant-conversion.m‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@ int main() {
1212
B =YES;
1313
B =NO;
1414

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}}
1818
B =YES |YES;
1919

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}}
2121

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}}
2424

2525
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}}
2727

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}}
2929
}
3030

3131
@interfaceBoolProp
3232
@propertyBOOL b;
3333
@end
3434

3535
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}}
3838
}

‎test/Sema/tautological-objc-bool-compare.m‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
voidtest() {
1010
int r;
1111
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}}
1313
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}}
1616
r = B <=0;
1717

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}}
1919
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}}
2121
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}}
2323
r = B <=NO;
2424
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp