diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/warn/overflow-warn-5.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/warn/overflow-warn-5.C | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/warn/overflow-warn-5.C b/gcc-4.9/gcc/testsuite/g++.dg/warn/overflow-warn-5.C new file mode 100644 index 000000000..bdfec4a6b --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/warn/overflow-warn-5.C @@ -0,0 +1,11 @@ +/* PR c/27273 */ +/* { dg-do compile } */ + +// This used to warn about "overflow in implicit constant conversion", +// which was wrong; 512 is never converted to unsigned char. Rather, an +// appropriate warning would be that the & expression always evaluates to 0 +// because of the limited range of unsigned char. + +unsigned char rx_async(unsigned char p) { + return p & 512; /* { dg-warning "" "" { xfail *-*-* } } */ +} |