PR c++/9364, c++/10553, c++/10586

PR c++/9364, c++/10553, c++/10586
	* decl.c (make_typename_type): Don't crash on illegal code.

	* g++.dg/parse/typename4.C: New test.
	* g++.dg/parse/typename5.C: Likewise.

From-SVN: r66424
This commit is contained in:
Kriang Lerdsuwanakij 2003-05-03 11:58:17 +00:00 committed by Kriang Lerdsuwanakij
parent 82a98427a9
commit 5dc5d13c70
5 changed files with 35 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2003-05-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9364, c++/10553, c++/10586
* decl.c (make_typename_type): Don't crash on illegal code.
2003-05-03 Nathan Sidwell <nathan@codesourcery.com>
* class.c (finish_struct): Use location_t and input_location

View File

@ -5418,6 +5418,11 @@ make_typename_type (tree context, tree name, tsubst_flags_t complain)
{
tree fullname;
if (name == error_mark_node
|| context == NULL_TREE
|| context == error_mark_node)
return error_mark_node;
if (TYPE_P (name))
{
if (!(TYPE_LANG_SPECIFIC (name)

View File

@ -1,3 +1,9 @@
2003-05-03 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/9364, c++/10553, c++/10586
* g++.dg/parse/typename4.C: New test.
* g++.dg/parse/typename5.C: Likewise.
2003-05-03 Richard Sandiford <rsandifo@redhat.com>
* gcc.c-torture/compile/20030503-1.c: New test.

View File

@ -0,0 +1,7 @@
// { dg-do compile }
// Origin: Christian Ehrhardt <ehrhardt@mathematik.uni-ulm.de>
// PR c++/9364: ICE processing typename with name error.
void find(typename int&); // { dg-error "typename|void|expected" }

View File

@ -0,0 +1,12 @@
// { dg-do compile }
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// PR c++/10553: ICE processing typename with context error.
template <typename> struct A {};
template <typename> struct B
{
typedef A<typename X::Y> C; // { dg-error "not a class-name|invalid|no type" }
};