public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51777] New: Errors message show unsigned long template parameters as signed
@ 2012-01-06 20:37 luto at mit dot edu
  2012-01-09 12:13 ` [Bug c++/51777] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: luto at mit dot edu @ 2012-01-06 20:37 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51777

             Bug #: 51777
           Summary: Errors message show unsigned long template parameters
                    as signed
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: luto@mit.edu


On x86_64, with g++ (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) and some trunk build
or other, this test:

template<unsigned long long>
struct A
{
};

int main()
{
  return A<0xf000000000000000ul>();
}

gives this error:

type_err_test.cc: In function ‘int main()’:
type_err_test.cc:8:34: error: cannot convert ‘A<-1152921504606846976ull>’ to
‘int’ in return

That's wrong -- the constant is positive.  (With just 'unsigned long' instead
of 'unsigned long long', it still gets it wrong on x86_64 but it gets it right
with -m32.  With 'unsigned long long' it fails both ways.)

I'm marking this "minor" because it's unlikely to cause significant confusion.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/51777] Errors message show unsigned long template parameters as signed
  2012-01-06 20:37 [Bug c++/51777] New: Errors message show unsigned long template parameters as signed luto at mit dot edu
@ 2012-01-09 12:13 ` rguenth at gcc dot gnu.org
  2012-01-16 16:12 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-09 12:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51777

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-09
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-09 12:13:03 UTC ---
Confirmed.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/51777] Errors message show unsigned long template parameters as signed
  2012-01-06 20:37 [Bug c++/51777] New: Errors message show unsigned long template parameters as signed luto at mit dot edu
  2012-01-09 12:13 ` [Bug c++/51777] " rguenth at gcc dot gnu.org
@ 2012-01-16 16:12 ` paolo.carlini at oracle dot com
  2012-01-17 11:11 ` paolo at gcc dot gnu.org
  2012-01-17 11:13 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-16 16:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51777

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |paolo.carlini at oracle dot
                   |gnu.org                     |com
   Target Milestone|---                         |4.7.0

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-16 15:58:28 UTC ---
Seems easy: just use the same code as dump_generic_node case INTEGER_CST, that
is call either pp_wide_integer or pp_unsigned_wide_integer. I have a patch.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/51777] Errors message show unsigned long template parameters as signed
  2012-01-06 20:37 [Bug c++/51777] New: Errors message show unsigned long template parameters as signed luto at mit dot edu
  2012-01-09 12:13 ` [Bug c++/51777] " rguenth at gcc dot gnu.org
  2012-01-16 16:12 ` paolo.carlini at oracle dot com
@ 2012-01-17 11:11 ` paolo at gcc dot gnu.org
  2012-01-17 11:13 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-01-17 11:11 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51777

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-01-17 11:05:23 UTC ---
Author: paolo
Date: Tue Jan 17 11:05:20 2012
New Revision: 183238

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183238
Log:
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.

Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-pretty-print.c


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/51777] Errors message show unsigned long template parameters as signed
  2012-01-06 20:37 [Bug c++/51777] New: Errors message show unsigned long template parameters as signed luto at mit dot edu
                   ` (2 preceding siblings ...)
  2012-01-17 11:11 ` paolo at gcc dot gnu.org
@ 2012-01-17 11:13 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-01-17 11:13 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51777

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-01-17 11:06:59 UTC ---
Done.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-17 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-06 20:37 [Bug c++/51777] New: Errors message show unsigned long template parameters as signed luto at mit dot edu
2012-01-09 12:13 ` [Bug c++/51777] " rguenth at gcc dot gnu.org
2012-01-16 16:12 ` paolo.carlini at oracle dot com
2012-01-17 11:11 ` paolo at gcc dot gnu.org
2012-01-17 11:13 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).