re PR c++/13407 (Confusing error message from extraneous typename)

PR c++/13407
	* g++.dg/parse/typename6.C: New test.

From-SVN: r75970
This commit is contained in:
Giovanni Bajo 2004-01-16 12:33:28 +00:00
parent 1ed53ef30c
commit 1303d0344b
2 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2004-01-15 Giovanni Bajo <giovannibajo@gcc.gnu.org>
PR c++/13407
* g++.dg/parse/typename6.C: New test.
2004-01-15 Geoffrey Keating <geoffk@apple.com>
PR pch/13361

View File

@ -0,0 +1,17 @@
// { dg-do compile }
// Contributed by Matt Austern <austern at apple dot com>
// PR c++/13407: Gracefully handle keyword typename in base class specifier.
struct A { };
struct B { typedef A Type; };
template <typename T>
struct X :
public typename T::Type // { dg-error "not allowed in this context" }
{ };
X<B> x;
struct C :
public typename A // { dg-error "not allowed outside of templates" }
{ };