Given the following C++ snippet:
template < typename T > class A { // 1
public : // 2
class AA { } ; // 3
} ; // 4
// 5
template < typename T > class B { // 6
friend class A < T > :: AA ; // 7
} ; // 8
It compiles cleanly with Sun C++, HP C++, Intel ecc 7.1,
GNU g++ 2.95.3 and GNU g++ 2.96 .
However, GNU g++ 3.2 gives the following warning:
a.C:7: warning: `typename A<T>::AA' is implicitly a typename
a.C:7: warning: implicit typename is deprecated, please see the
documentation for details
Is there really anything wrong with the friend declaration, or is it a bug in
GNU g++ 3.2 ?
Replacing the keyword 'class' in line 7 by 'typename' makes
it compile cleanly with GNU g++, but gives compilation
errors with all non-GNU compilers.
Replacing 'class' by 'class typename' is not an option either.
Any thoughts?
Kind regards,
Ike
--
mail to ike at iae dot nl