From: Jakub Jelinek Date: Fri, 23 Mar 2018 20:54:01 +0000 (+0100) Subject: re PR c++/84942 (internal compiler error: in fold_convert_const_int_from_real, at... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1e7c3f2015247369b040a3ab24e85d4d68f51f4;p=gcc.git re PR c++/84942 (internal compiler error: in fold_convert_const_int_from_real, at fold-const.c:2011) PR c++/84942 * pt.c (tsubst_copy_and_build) : Replace cp_build_unary_op call with gcc_unreachable (). * g++.dg/cpp1y/pr84942.C: New test. From-SVN: r258821 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ddda091b5fd..619161bf323 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-03-23 Jakub Jelinek + + PR c++/84942 + * pt.c (tsubst_copy_and_build) : Replace + cp_build_unary_op call with gcc_unreachable (). + 2018-03-23 Marek Polacek PR c++/85045 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 5293c2b5491..ef531b6d795 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -17514,8 +17514,7 @@ 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)); + gcc_unreachable (); case ADDR_EXPR: op1 = TREE_OPERAND (t, 0); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 503ddaa6053..419bd560dc5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-03-23 Jakub Jelinek + + PR c++/84942 + * g++.dg/cpp1y/pr84942.C: New test. + 2018-03-23 Vladimir Makarov PR inline-asm/85030 diff --git a/gcc/testsuite/g++.dg/cpp1y/pr84942.C b/gcc/testsuite/g++.dg/cpp1y/pr84942.C new file mode 100644 index 00000000000..6e2a8ac1a52 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr84942.C @@ -0,0 +1,6 @@ +// PR c++/84942 +// { dg-do compile { target c++14 } } +// { dg-options "-w" } + +int a(__attribute__((b((int)__builtin_inf() * 1ULL / auto)))); +// { dg-error "expected primary-expression before" "" { target *-*-* } .-1 }