Improve some of the conversion warnings to fire on conversion to bool.
Moves the bool bail-out down a little in SemaChecking - so now
-Wnull-conversion and -Wliteral-conversion can fire when the target type is
bool.
Also improve the wording/details in the -Wliteral-conversion warning to match
the -Wconstant-conversion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156826 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index 26c0b24..cfdf8e2 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -50,7 +50,7 @@
static long x2[3] = { 1.0,
"abc", // expected-warning{{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [4]'}}
- 5.8 }; // expected-warning {{implicit conversion turns literal floating-point number into integer}}
+ 5.8 }; // expected-warning {{implicit conversion from 'double' to 'long' changes value from 5.8 to 5}}
}
void test() {
diff --git a/test/Sema/knr-def-call.c b/test/Sema/knr-def-call.c
index f41275d..80ad0d8 100644
--- a/test/Sema/knr-def-call.c
+++ b/test/Sema/knr-def-call.c
@@ -36,6 +36,6 @@
}
void use_proto() {
- proto(42.1); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
- (&proto)(42.1); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
+ proto(42.1); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 42.1 to 42}}
+ (&proto)(42.1); // expected-warning{{implicit conversion from 'double' to 'int' changes value from 42.1 to 42}}
}