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]

Another picky-new-parser problem


The following testcase fails with the new parser while it succeeds
with other compilers:

template<class T, class U>
struct UnaryReturn {
        typedef T Type_t;
};

struct foo
{
        template <class T>
        typename UnaryReturn<T, int>::Type_t
        bar();
};

template<class T>
struct UnaryReturn<T, int> {
        typedef bool Type_t;
};

> g++ -c -Wall insbefdecl.cpp
insbefdecl.cpp:14: error: specialization of `UnaryReturn<T, int>' after
   instantiation

Moving the specialization before struct foo fixes the problem.

Should I file a gnats report on this?

Thanks, Richard.

--
Richard Guenther <richard.guenther@uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/


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