re PR c++/51777 (Errors message show unsigned long template parameters as signed)
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 17 Jan 2012 11:05:20 +0000 (11:05 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 17 Jan 2012 11:05:20 +0000 (11:05 +0000)
2012-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/51777
* c-pretty-print.c (pp_c_integer_constant): For unsigned constants
use pp_unsigned_wide_integer.

From-SVN: r183238

gcc/c-family/ChangeLog
gcc/c-family/c-pretty-print.c

index 10a9ddd86eaeb05369ad1d40e356642a2fa8ddea..2746d04fe4af918fd4a7a4139b53b63736615bc6 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-17  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/51777
+       * c-pretty-print.c (pp_c_integer_constant): For unsigned constants
+       use pp_unsigned_wide_integer.
+
 2012-01-10  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/51806
index be28b39e6a343081c29194cc36cb55f7ed77a53f..dc63f0048de43084c1732a70866116e72b51f609 100644 (file)
@@ -910,8 +910,10 @@ pp_c_integer_constant (c_pretty_printer *pp, tree i)
     ? TYPE_CANONICAL (TREE_TYPE (i))
     : TREE_TYPE (i);
 
-  if (TREE_INT_CST_HIGH (i) == 0)
+  if (host_integerp (i, 0))
     pp_wide_integer (pp, TREE_INT_CST_LOW (i));
+  else if (host_integerp (i, 1))
+    pp_unsigned_wide_integer (pp, TREE_INT_CST_LOW (i));
   else
     {
       unsigned HOST_WIDE_INT low = TREE_INT_CST_LOW (i);