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);

Reply via email to