This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30863] New: Unsigned templatized struct treated as unsigned int
- From: "stonebone at planetunreal dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2007 20:25:30 -0000
- Subject: [Bug c++/30863] New: Unsigned templatized struct treated as unsigned int
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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