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

--- Comment #6 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> So perhaps:
> 2021-03-08  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR c++/99459
>       * coroutines.cc (build_co_await): Look through NOP_EXPRs in
>       build_special_member_call return value to find the CALL_EXPR.
> 
> --- gcc/cp/coroutines.cc.jj   2021-03-05 21:51:48.671185716 +0100
> +++ gcc/cp/coroutines.cc      2021-03-08 10:53:13.187959339 +0100
> @@ -868,6 +868,8 @@ build_co_await (location_t loc, tree a,
>               = build_special_member_call (a, complete_dtor_identifier,
>                                            NULL, a_type, LOOKUP_NORMAL,
>                                            tf_none);
> +           if (dummy && CONVERT_EXPR_P (dummy))
> +             dummy = TREE_OPERAND (dummy, 0);
>             dummy = dummy ? TREE_OPERAND (CALL_EXPR_FN (dummy), 0)
>                           : NULL_TREE;
>             if (dummy && coro_diagnose_throwing_fn (dummy))
> @@ -1031,6 +1033,8 @@ build_co_await (location_t loc, tree a,
>           = build_special_member_call (e_proxy, complete_dtor_identifier,
>                                        NULL, o_type, LOOKUP_NORMAL,
>                                        tf_none);
> +       if (dummy && CONVERT_EXPR_P (dummy))
> +         dummy = TREE_OPERAND (dummy, 0);
>         dummy = dummy ? TREE_OPERAND (CALL_EXPR_FN (dummy), 0)
>                       : NULL_TREE;
>         if (dummy && coro_diagnose_throwing_fn (dummy))
> 
> ?

looks reasonable to me - but I have no way to test it at present.

Reply via email to