This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix g++.dg/warn/Wduplicated-branches1.C with -funsigned-char
- From: Marek Polacek <polacek at redhat dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 21 Jan 2017 12:59:19 +0100
- Subject: Fix g++.dg/warn/Wduplicated-branches1.C with -funsigned-char
- Authentication-results: sourceware.org; auth=none
This test failed on architectures where char is unsigned by default, or
on x86_64 with -funsigned-char. Fixed by using 'signed' explicitly.
Tested on x86_64-linux, applying to trunk.
2017-01-21 Marek Polacek <polacek@redhat.com>
PR testsuite/79169
* g++.dg/warn/Wduplicated-branches1.C: Use signed char.
diff --git gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C
index 7ebd55e..1553613 100644
--- gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C
+++ gcc/testsuite/g++.dg/warn/Wduplicated-branches1.C
@@ -4,7 +4,7 @@
template <typename T>
void
-f (char i, int *p)
+f (signed char i, int *p)
{
if (i)
*p = (signed short) i;
@@ -17,5 +17,5 @@ f (char i, int *p)
*p = (unsigned short) i;
}
-template void f<unsigned short>(char, int *); // { dg-message "required from here" }
-template void f<signed short>(char, int *);
+template void f<unsigned short>(signed char, int *); // { dg-message "required from here" }
+template void f<signed short>(signed char, int *);
Marek