[Insight-developers] Annoying GCC Warning: Implicit typename deprecated?

Kent Williams norman-k-williams@uiowa.edu
Wed, 23 Apr 2003 17:12:06 -0500


Well I'm working on some stuff that I've not checked in yet, and I'm runn=
ing=20
into this petty annoyance from GCC:

=2E../SpatialObject/itkROIStrandSpatialObject.txx:30: warning: implicit =20
typename is deprecated, please see the documentation for details

Now I can shut that up most of the time by putting a 'typename' keyword i=
n=20
front of the offending type, but their are odd cases when doing so genera=
tes
a compiler error with g++ 3.2.2.

For example, my ROIStrandSpatialObject<unsigned Int TDimension> derives f=
rom
itk::BlobSpatialObject.  I need to iterate thru the list returned by=20
this->SpatialObject::GetChildren(), so in a member function I have

1: ChildrenListType *points =3D this->GetChildren();

where ChildrenListType is defined in SpatialObject:

typedef std::list< Self * > ChildrenListType;=20

Line XXX generates the 'implicit typename is deprecated' error, and addin=
g=20
typename in front of ChildrenListType generates a compiler error. If I do=
=20
this:

typename SpatialObject<TDimension>::ChildrenListType *points =3D=20
this->GetChildren();

Then the compiler shuts up. I have more convoluted cases in which I seem =
not=20
to be able get the warning to go away without throwing a compile error.
I guess what I'm asking is for a C++ Minor Diety among you who can point =
me to=20
some sort of documentation that will tell me how to properly deal with th=
is=20
error, or some guidance on whether to worry about it.