This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 2.95.2 bug with typename and templates
Nathan Sidwell <nathan@codesourcery.com> writes:
| Peter Fraser wrote:
| >
| > template<class LB> class C
| > {
| > public:
| > typename LB::DataType;
| >
| > void FillBox(LB::DataType &info);
| > };
|
| > gcc is deciding that "LB::Datatype &info" is an expression
| > rather that a parameter declaration. gcc is behaving as if
| > it is ignoring the "typename" declaration.
| you misunderstand typename.
More importantly, the construct
typename LB::DataType;
is ill-formed and should be diagnosed as per 7.1.5.3/1; what GCC
failed to.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com