L
lutorm
Hi all,
I'm working on migrating my code from KCC to gcc, and I'm having some
issues with "implicit typename" warnings from gcc. Essentially, what
happens is described by this example:
template <typename cell_data_type> class cell {};
template <typename a> class c1 {
public:
typedef cell<a> T_cell;
};
template <typename a> class c2 : public c1<a> {
T_cell func();
};
Trying to compile this code, results in this message from gcc:
[40]patrik@rumba:/u/patrik/sunrise/src% g++ -c typename.cc
typename.cc:9: warning: `typename c2<a>::T_cell' is implicitly a
typename
typename.cc:9: warning: implicit typename is deprecated, please see the
documentation for details
I don't understand what is implicit about this type. It's not implicit
in class c1, so how come it's implicit in class c2? The problem is not
correctable by adding typename to the offending line; this results in a
compilation error. Redefining the typedef in c2 removes the warning,
but that makes the idea of public typedefs useless...
Does this behavior makes sense to people?
Thanks,
/Patrik
I'm working on migrating my code from KCC to gcc, and I'm having some
issues with "implicit typename" warnings from gcc. Essentially, what
happens is described by this example:
template <typename cell_data_type> class cell {};
template <typename a> class c1 {
public:
typedef cell<a> T_cell;
};
template <typename a> class c2 : public c1<a> {
T_cell func();
};
Trying to compile this code, results in this message from gcc:
[40]patrik@rumba:/u/patrik/sunrise/src% g++ -c typename.cc
typename.cc:9: warning: `typename c2<a>::T_cell' is implicitly a
typename
typename.cc:9: warning: implicit typename is deprecated, please see the
documentation for details
I don't understand what is implicit about this type. It's not implicit
in class c1, so how come it's implicit in class c2? The problem is not
correctable by adding typename to the offending line; this results in a
compilation error. Redefining the typedef in c2 removes the warning,
but that makes the idea of public typedefs useless...
Does this behavior makes sense to people?
Thanks,
/Patrik