Commit a30f62e0 by Mark Mitchell Committed by Mark Mitchell

re PR c++/15165 (ICE in instantiate_template)

	PR c++/15165
	* pt.c (instantiate_template): Robustify.

	PR c++/15165
	* g++.dg/template/crash19.C: New test.

From-SVN: r82174
parent 9ce1594a
2004-05-23 Mark Mitchell <mark@codesourcery.com>
PR c++/15165
* pt.c (instantiate_template): Robustify.
2004-05-23 Mark Mitchell <mark@codesourcery.com>
PR c++/15025
* decl.c (xref_tag): Issue errors about redeclaring template
classes as non-template classes.
......
......@@ -8661,10 +8661,14 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
/* If this function is a clone, handle it specially. */
if (DECL_CLONED_FUNCTION_P (tmpl))
{
tree spec = instantiate_template (DECL_CLONED_FUNCTION (tmpl), targ_ptr,
complain);
tree spec;
tree clone;
spec = instantiate_template (DECL_CLONED_FUNCTION (tmpl), targ_ptr,
complain);
if (spec == error_mark_node)
return error_mark_node;
/* Look for the clone. */
for (clone = TREE_CHAIN (spec);
clone && DECL_CLONED_FUNCTION_P (clone);
......
2004-05-23 Mark Mitchell <mark@codesourcery.com>
PR c++/15165
* g++.dg/template/crash19.C: New test.
2004-05-23 Mark Mitchell <mark@codesourcery.com>
PR c++/15025
* g++.dg/template/redecl1.C: New test.
......
// PR c++/15165
struct S
{
template <class T> S(const T &e);
};
int operator *(const double, const S &);
template <class T>
struct X {
enum { SIXTY_FOUR=64 };
struct node {
unsigned char *ptr[sizeof(T)*SIXTY_FOUR];
void d() {}
};
node *head;
};
template struct X<int>;
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