Commit 22531fb1 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/54844 (ice tsubst_copy, at cp/pt.c:12352)

	PR c++/54844
	* pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
	tsubst instead of tsubst_copy* on types.

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

From-SVN: r192736
parent 8d672b26
2012-10-23 Jakub Jelinek <jakub@redhat.com>
PR c++/54844
* pt.c (tsubst_copy, tsubst_copy_and_build) <case SIZEOF_EXPR>: Use
tsubst instead of tsubst_copy* on types.
PR c++/54988
* decl2.c (cplus_decl_attributes): Don't return early
if attributes is NULL.
......
......@@ -12104,8 +12104,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
}
if (SIZEOF_EXPR_TYPE_P (t))
{
r = tsubst_copy (TREE_TYPE (TREE_OPERAND (t, 0)),
args, complain, in_decl);
r = tsubst (TREE_TYPE (TREE_OPERAND (t, 0)),
args, complain, in_decl);
r = build1 (NOP_EXPR, r, error_mark_node);
r = build1 (SIZEOF_EXPR,
tsubst (TREE_TYPE (t), args, complain, in_decl), r);
......@@ -13533,10 +13533,13 @@ tsubst_copy_and_build (tree t,
{
++cp_unevaluated_operand;
++c_inhibit_evaluation_warnings;
op1 = tsubst_copy_and_build (op1, args, complain, in_decl,
/*function_p=*/false,
/*integral_constant_expression_p=*/
false);
if (TYPE_P (op1))
op1 = tsubst (op1, args, complain, in_decl);
else
op1 = tsubst_copy_and_build (op1, args, complain, in_decl,
/*function_p=*/false,
/*integral_constant_expression_p=*/
false);
--cp_unevaluated_operand;
--c_inhibit_evaluation_warnings;
}
......
2012-10-23 Jakub Jelinek <jakub@redhat.com>
PR c++/54844
* g++.dg/template/sizeof14.C: New test.
2012-10-23 Ian Bolton <ian.bolton@arm.com>
Jim MacArthur <jim.macarthur@arm.com>
Chris Schlumberger-Socha <chris.schlumberger-socha@arm.com>
......
// PR c++/54844
// { dg-do compile }
template <int N> int fn () { return sizeof (double); }
int var = fn <0> ();
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