[Bug c++/84942] [6/7/8 Regression] internal compiler error: in fold_convert_const_int_from_real, at fold-const.c:2011
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Mar 19 10:06:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84942
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Using cp_build_unary_op for FIX_TRUNC_EXPR looks wrong to me, that function
uses the type of the operand as the type of the unary expression.
Perhaps:
--- gcc/cp/pt.c.jj 2018-03-16 21:11:04.440773108 +0100
+++ gcc/cp/pt.c 2018-03-19 10:58:39.803657613 +0100
@@ -17495,8 +17495,10 @@ tsubst_copy_and_build (tree t,
complain|decltype_flag));
case FIX_TRUNC_EXPR:
- RETURN (cp_build_unary_op (FIX_TRUNC_EXPR, RECUR (TREE_OPERAND (t, 0)),
- false, complain));
+ op1 = RECUR (TREE_OPERAND (t, 0));
+ if (error_operand_p (op1))
+ RETURN (error_mark_node);
+ RETURN (build1 (FIX_TRUNC_EXPR, TREE_TYPE (t), op1));
case ADDR_EXPR:
op1 = TREE_OPERAND (t, 0);
More information about the Gcc-bugs
mailing list