summaryrefslogtreecommitdiffstats
path: root/test/Sema/knr-def-call.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/knr-def-call.c')
-rw-r--r--test/Sema/knr-def-call.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/Sema/knr-def-call.c b/test/Sema/knr-def-call.c
index 66f2ec0..d054a04 100644
--- a/test/Sema/knr-def-call.c
+++ b/test/Sema/knr-def-call.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -Wconversion -Wliteral-conversion -fsyntax-only -verify %s
// C DR #316, PR 3626.
void f0(a, b, c, d) int a,b,c,d; {}
@@ -23,7 +23,19 @@ void f4() {
}
char *rindex(s, c)
- register char *s, c; // expected-warning{{promoted type 'char *' of K&R function parameter is not compatible with the parameter type 'char const *' declared in a previous prototype}}
+ register char *s, c; // expected-warning{{promoted type 'char *' of K&R function parameter is not compatible with the parameter type 'const char *' declared in a previous prototype}}
{
return 0;
}
+
+// PR8314
+void proto(int);
+void proto(x)
+ int x;
+{
+}
+
+void use_proto() {
+ proto(42.0); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
+ (&proto)(42.0); // expected-warning{{implicit conversion turns literal floating-point number into integer}}
+}
OpenPOWER on IntegriCloud