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

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

https://gcc.gnu.org/g:c847dcf94499da62e5a28921b404e6e561645d99

commit r15-1759-gc847dcf94499da62e5a28921b404e6e561645d99
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.
  • [Bug c++/115430] Cannot take ad... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to