Author: compnerd
Date: Wed Sep 19 11:41:07 2018
New Revision: 342569

URL: http://llvm.org/viewvc/llvm-project?rev=342569&view=rev
Log:
test: improve condition for the check

When the type of `wint_t` is `int`, the promotion will allow this to pass.
Check this explicitly rather than using the size.

Modified:
    cfe/trunk/test/Sema/format-strings.c

Modified: cfe/trunk/test/Sema/format-strings.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings.c?rev=342569&r1=342568&r2=342569&view=diff
==============================================================================
--- cfe/trunk/test/Sema/format-strings.c (original)
+++ cfe/trunk/test/Sema/format-strings.c Wed Sep 19 11:41:07 2018
@@ -401,7 +401,7 @@ void bug7377_bad_length_mod_usage() {
 void pr7981(wint_t c, wchar_t c2) {
   printf("%lc", c); // no-warning
   printf("%lc", 1.0); // expected-warning{{the argument has type 'double'}}
-#if __WINT_WIDTH__ == 4
+#if __WINT_TYPE__ == int
   printf("%lc", (char) 1); // no-warning
 #else
   printf("%lc", (char) 1); // expected-warning{{the argument has type 'char'}}


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to