This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/30754] New: mystefying error "type A is not derived from type B"
- From: "benoit dot hudson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Feb 2007 03:06:16 -0000
- Subject: [Bug c++/30754] New: mystefying error "type A is not derived from type B"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#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