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

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).