Commit 5dc5d13c by Kriang Lerdsuwanakij Committed by Kriang Lerdsuwanakij

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
parent 82a98427
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
......
......@@ -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)
......
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.
......
// { 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" }
// { 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" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment