public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30863]  New: Unsigned templatized struct treated as unsigned int
@ 2007-02-19 20:25 stonebone at planetunreal dot com
  2007-02-19 20:39 ` [Bug c++/30863] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: stonebone at planetunreal dot com @ 2007-02-19 20:25 UTC (permalink / raw)
  To: gcc-bugs

test.cc:

#include <stdio.h>

template<typename T>
struct s {
        s() {
                printf("Print me, please!\n");
        }
};

int main(){
        s<int> x;
        unsigned s<int> y;
}


% g++ -Wall test.cc -o test &&./test
test.cc: In function 'int main()':
test.cc:12: warning: unused variable 'y'
Print me, please!


First of all, I find it surprising that this even compiles. Secondly, the
"unsigned s<int>" is treated as "unsigned int" (note that "Print me, please!"
is only printed once).


-- 
           Summary: Unsigned templatized struct treated as unsigned int
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stonebone at planetunreal dot com


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


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

end of thread, other threads:[~2008-07-04 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 20:25 [Bug c++/30863] New: Unsigned templatized struct treated as unsigned int stonebone at planetunreal dot com
2007-02-19 20:39 ` [Bug c++/30863] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-03-05  3:59 ` mmitchel at gcc dot gnu dot org
2007-03-23  1:08 ` mmitchel at gcc dot gnu dot org
2007-03-23  4:37 ` mmitchel at gcc dot gnu dot org
2007-03-23  4:38 ` mmitchel at gcc dot gnu dot org
2007-03-23  4:38 ` [Bug c++/30863] [4.1 " mmitchel at gcc dot gnu dot org
2008-07-04 16:01 ` jsm28 at gcc dot gnu dot org

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