[Bug c++/91962] [10 Regression] ice in build_target_expr, at cp/tree.c:488

mpolacek at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 24 14:05:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91962

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fix:

--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7386,7 +7386,8 @@ convert_like_real (conversion *convs, tree expr, tree fn,
int argnum,
    /* direct_reference_binding might have inserted a ck_qual under
       this ck_ref_bind for the benefit of conversion sequence ranking.
       Ignore the conversion; we'll create our own below.  */
-   if (next_conversion (convs)->kind == ck_qual)
+   if (next_conversion (convs)->kind == ck_qual
+       && !convs->need_temporary_p)
      {
        gcc_assert (same_type_p (TREE_TYPE (expr),
                     next_conversion (convs)->type));


More information about the Gcc-bugs mailing list