This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]