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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Marek Polacek
<mpola...@gcc.gnu.org>:

https://gcc.gnu.org/g:21600f3a6f23390c25a73e1cbfcfc544b7133d53

commit r14-11169-g21600f3a6f23390c25a73e1cbfcfc544b7133d53
Author: Marek Polacek <pola...@redhat.com>
Date:   Tue Jun 25 17:42:01 2024 -0400

    c++: unresolved overload with comma op [PR115430]

    This works:

      template<typename T>
      int Func(T);
      typedef int (*funcptrtype)(int);
      funcptrtype fp0 = &Func<int>;

    but this doesn't:

      funcptrtype fp2 = (0, &Func<int>);

    because we only call resolve_nondeduced_context on the LHS (via
    convert_to_void) but not on the RHS, so cp_build_compound_expr's
    type_unknown_p check issues an error.

            PR c++/115430

    gcc/cp/ChangeLog:

            * typeck.cc (cp_build_compound_expr): Call
resolve_nondeduced_context
            on RHS.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/noexcept41.C: Remove dg-error.
            * g++.dg/overload/addr3.C: New test.

    (cherry picked from commit c847dcf94499da62e5a28921b404e6e561645d99)

Reply via email to