re PR c++/10793 (ICE (treecheck) when partial-specializing with an invalid type and a base class, in xref_basetypes, at cp/decl.c:12834)

PR c++/10793
	* decl.c (xref_basetypes): Handle error_mark_node.

	* g++.dg/template/crash9.C: New test.

From-SVN: r69671
This commit is contained in:
Kriang Lerdsuwanakij 2003-07-22 14:36:00 +00:00 committed by Kriang Lerdsuwanakij
parent 4bd5635487
commit bef89e9e09
4 changed files with 22 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2003-07-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10793
* decl.c (xref_basetypes): Handle error_mark_node.
2003-07-22 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (enum cp_lvalue_kind): Add clk_packed.

View File

@ -12831,6 +12831,9 @@ xref_basetypes (tree ref, tree base_list)
int i;
enum tag_types tag_code;
if (ref == error_mark_node)
return;
if (TREE_CODE (ref) == UNION_TYPE)
{
error ("derived union `%T' invalid", ref);

View File

@ -1,3 +1,8 @@
2003-07-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10793
* g++.dg/template/crash9.C: New test.
2003-07-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/3004

View File

@ -0,0 +1,9 @@
// { dg-do compile }
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
// PR c++/10793: ICE in handling base class when the current class
// contains error.
template <typename> struct A {};
template <typename> struct A<INVALID> : A<int> { }; // { dg-error "not declared|invalid" }