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.
}
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);
{
++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>