Commit 7349ed05 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/56819 (ICE: SIGSEGV in int_cst_value (tree.h:4013) with -fcompare-debug)

	PR debug/56819
	* tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
	from args to new_args.
	(strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
	r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.

	* g++.dg/debug/pr56819.C: New test.

From-SVN: r197420
parent 994a4cc0
2013-04-03 Jakub Jelinek <jakub@redhat.com>
PR debug/56819
* tree.c (strip_typedefs): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT
from args to new_args.
(strip_typedefs_expr): Copy NON_DEFAULT_TEMPLATE_ARGS_COUNT from t to
r instead of doing {S,G}ET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
2013-04-02 Jason Merrill <jason@redhat.com> 2013-04-02 Jason Merrill <jason@redhat.com>
PR c++/56821 PR c++/56821
......
...@@ -1255,8 +1255,13 @@ strip_typedefs (tree t) ...@@ -1255,8 +1255,13 @@ strip_typedefs (tree t)
changed = true; changed = true;
} }
if (changed) if (changed)
fullname = lookup_template_function (TREE_OPERAND (fullname, 0), {
new_args); NON_DEFAULT_TEMPLATE_ARGS_COUNT (new_args)
= NON_DEFAULT_TEMPLATE_ARGS_COUNT (args);
fullname
= lookup_template_function (TREE_OPERAND (fullname, 0),
new_args);
}
else else
ggc_free (new_args); ggc_free (new_args);
} }
...@@ -1389,8 +1394,8 @@ strip_typedefs_expr (tree t) ...@@ -1389,8 +1394,8 @@ strip_typedefs_expr (tree t)
r = copy_node (t); r = copy_node (t);
for (i = 0; i < n; ++i) for (i = 0; i < n; ++i)
TREE_VEC_ELT (r, i) = (*vec)[i]; TREE_VEC_ELT (r, i) = (*vec)[i];
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT NON_DEFAULT_TEMPLATE_ARGS_COUNT (r)
(r, GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (t)); = NON_DEFAULT_TEMPLATE_ARGS_COUNT (t);
} }
else else
r = t; r = t;
......
2013-04-03 Jakub Jelinek <jakub@redhat.com>
PR debug/56819
* g++.dg/debug/pr56819.C: New test.
2013-04-03 Richard Biener <rguenther@suse.de> 2013-04-03 Richard Biener <rguenther@suse.de>
PR tree-optimization/56817 PR tree-optimization/56817
......
// PR debug/56819
// { dg-do compile }
// { dg-options "-fcompare-debug" }
template <typename>
struct A
{
template <typename>
struct B;
};
template <typename>
struct C
{
typedef int I;
};
template <typename T>
class D
{
typedef A <void> E;
typedef typename T::template B <E> F;
typedef typename C <F>::I I;
A <I> foo () { return A<I> (); }
};
template class D <A <void> >;
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