This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Type lookup problem in local template class?
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 20 Nov 2002 16:52:03 +0100 (CET)
- Subject: Type lookup problem in local template class?
The following code gives a parse error with g++ 3.2 (3.0, too):
template <class X>
struct B {
template <class Y>
struct C {
typedef Y Y_t;
void foo(Y_t&);
};
};
template <class X, class Y>
void B<X>::template C<Y>::foo(Y_t&)
{
}
If changing Y for Y_t in the definition of foo the parse error
goes away. Intel icpc 6.0.1 does not parse this in any of both
cases. Clearly Y_t should be visible in foo, no? If not, is the
intel compiler right in rejecting the code if using Y instead of
Y_t?
Confused, Richard.
--
Richard Guenther <richard.guenther@uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
The GLAME Project: http://www.glame.de/