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]

New parser overly picky?


Hi!

The following testcase fails with the new parser (g++ (GCC) 3.4 20030113
(experimental)):

template <class A>
class foo {
        foo();
        template <class B>
        class bar {
        };
};

template <class A>
foo<A>::foo()
{
        typedef typename foo<A>::bar<int> bar_t;
}

> g++ -c -Wall pclass.cpp
pclass.cpp: In constructor `foo<A>::foo()':
pclass.cpp:13: error: no type named `bar' in `class foo<A>'
pclass.cpp:13: error: expected primary-expression
pclass.cpp:13: error: expected `;'

while other versions are happy. Changing the typedef to

typedef bar<int> bar_t;

makes the parser happy again. Is this "correct"? At least the error
message is not helpful - if it is, its a access rights problem.

Should I file a gnats report?

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]