This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35228] New: template accepting numeric fails with sizeof
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Feb 2008 08:41:36 -0000
- Subject: [Bug c++/35228] New: template accepting numeric fails with sizeof
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This code:
template<int i>
class foo {
public:
typedef
unsigned int unsigned_t;
typedef
signed int signed_t;
};
template<typename T>
class bar {
public:
typedef
foo<8>::unsigned_t baz1;
typedef
foo<sizeof(T)>::unsigned_t baz2;
};
bar<int> var;
gets you this:
~/ootbc/personal/ivan$ c++ foo.cc
foo.cc:16: error: type 'foo<sizeof (T)>' is not derived from type 'bar<T>'
foo.cc:16: error: expected ';' before 'baz2'
--
Summary: template accepting numeric fails with sizeof
Product: gcc
Version: 4.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35228