[Bug c++/30754] New: mystefying error "type A is not derived from type B"
benoit dot hudson at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sat Feb 10 03:06:00 GMT 2007
#include <vector>
template <class C>
class Cow {
typedef std::vector<C> vect;
typedef vect::iterator it;
};
On line 5, the iterator typedef, I get the very odd error that (reconstituting
the types) vect::iterator is not derived from type Cow<C>.
It took me rather a long time to figure out that what it meant is that I needed
to write:
typedef typename vect::iterator it;
How in the world did this get turned into an error about how "type A is not
derived from type B" ?
This is gcc-3.4, 4.0, and 4.1 ; 3.2 and 3.3 warn me it's implicitely a
typename.
--
Summary: mystefying error "type A is not derived from type B"
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: benoit dot hudson at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30754
More information about the Gcc-bugs
mailing list