diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2019-09-17 18:02:45 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2019-09-17 18:02:45 +0000 |
commit | a1e29a3407fbb801a6a23e490f1bbf8a4167a5b8 (patch) | |
tree | b0d4c58e2ec10c144da030c825ec732abaf7308a | |
parent | 1fb584f7a272ba2ed91a735d4d97a2abeb85693e (diff) | |
download | bcm5719-llvm-a1e29a3407fbb801a6a23e490f1bbf8a4167a5b8.tar.gz bcm5719-llvm-a1e29a3407fbb801a6a23e490f1bbf8a4167a5b8.zip |
Use 'BOOL' instead of BOOL in diagnostic messages
Type names should be enclosed in single quotes.
llvm-svn: 372152
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 8 | ||||
-rw-r--r-- | clang/test/Sema/objc-bool-constant-conversion.m | 20 | ||||
-rw-r--r-- | clang/test/Sema/tautological-objc-bool-compare.m | 12 |
3 files changed, 20 insertions, 20 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index b80cda52ca5..55f7ed0f792 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -3291,8 +3291,8 @@ def warn_impcast_bitfield_precision_constant : Warning< "implicit truncation from %2 to bit-field changes value from %0 to %1">, InGroup<BitFieldConstantConversion>; def warn_impcast_constant_int_to_objc_bool : Warning< - "implicit conversion from constant value %0 to BOOL; " - "the only well defined values for BOOL are YES and NO">, + "implicit conversion from constant value %0 to 'BOOL'; " + "the only well defined values for 'BOOL' are YES and NO">, InGroup<ObjCBoolConstantConversion>; def warn_impcast_fixed_point_range : Warning< @@ -6109,8 +6109,8 @@ def warn_tautological_constant_compare : Warning< "%select{%1|%3}0 is always %4">, InGroup<TautologicalTypeLimitCompare>, DefaultIgnore; def warn_tautological_compare_objc_bool : Warning< - "result of comparison of constant %0 with expression of type BOOL" - " is always %1, as the only well defined values for BOOL are YES and NO">, + "result of comparison of constant %0 with expression of type 'BOOL'" + " is always %1, as the only well defined values for 'BOOL' are YES and NO">, InGroup<TautologicalObjCBoolCompare>; def warn_mixed_sign_comparison : Warning< diff --git a/clang/test/Sema/objc-bool-constant-conversion.m b/clang/test/Sema/objc-bool-constant-conversion.m index 3638e2f8a9d..25546ab0a64 100644 --- a/clang/test/Sema/objc-bool-constant-conversion.m +++ b/clang/test/Sema/objc-bool-constant-conversion.m @@ -12,20 +12,20 @@ int main() { B = YES; B = NO; - B = -1; // expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}} - B = 0 - 1; // expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}} - B = YES + YES; // expected-warning {{implicit conversion from constant value 2 to BOOL; the only well defined values for BOOL are YES and NO}} + B = -1; // expected-warning{{implicit conversion from constant value -1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} + B = 0 - 1; // expected-warning{{implicit conversion from constant value -1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} + B = YES + YES; // expected-warning {{implicit conversion from constant value 2 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} B = YES | YES; - 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}} + 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}} - BOOL Init = -1; // expected-warning{{implicit conversion from constant value -1 to BOOL; the only well defined values for BOOL are YES and NO}} - 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}} + BOOL Init = -1; // expected-warning{{implicit conversion from constant value -1 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} + 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}} void takesbool(BOOL); - takesbool(43); // expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}} + takesbool(43); // expected-warning {{implicit conversion from constant value 43 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} - BOOL OutOfRange = 400; // expected-warning{{implicit conversion from constant value 400 to BOOL; the only well defined values for BOOL are YES and NO}} + BOOL OutOfRange = 400; // expected-warning{{implicit conversion from constant value 400 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} } @interface BoolProp @@ -33,6 +33,6 @@ int main() { @end void f(BoolProp *bp) { - bp.b = 43; // expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}} - [bp setB:43]; // expected-warning {{implicit conversion from constant value 43 to BOOL; the only well defined values for BOOL are YES and NO}} + bp.b = 43; // expected-warning {{implicit conversion from constant value 43 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} + [bp setB:43]; // expected-warning {{implicit conversion from constant value 43 to 'BOOL'; the only well defined values for 'BOOL' are YES and NO}} } diff --git a/clang/test/Sema/tautological-objc-bool-compare.m b/clang/test/Sema/tautological-objc-bool-compare.m index 525862ed9ea..5fd7b9e1289 100644 --- a/clang/test/Sema/tautological-objc-bool-compare.m +++ b/clang/test/Sema/tautological-objc-bool-compare.m @@ -9,16 +9,16 @@ BOOL B; void test() { int r; r = B > 0; - 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}} + 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}} r = B < 1; - 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}} - 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}} + 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}} + 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}} r = B <= 0; - 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}} + 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}} r = B > NO; - 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}} + 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}} r = B < YES; - 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}} + 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}} r = B <= NO; } |