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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:70bf0ee44017e8e26bb1bdcb6a3fd114c25c39c7

commit r15-9177-g70bf0ee44017e8e26bb1bdcb6a3fd114c25c39c7
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Apr 3 13:21:56 2025 +0200

    c++: Fix typo in RAW_DATA_CST build_list_conv subsubconv hanling [PR119563]

    The following testcase ICEs (the embed one actually doesn't but
    dereferences random uninitialized pointer far after allocated memory)
    because of a typo.  In the RAW_DATA_CST handling of list conversion
    where there are conversions to something other than
    initializer_list<{{,un}signed ,}char>, the code now calls
    implicit_conversion for all the RAW_DATA_CST elements and stores them
    into subsubconvs array.
    The next loop (done in a separate loop because subsubconvs[0] is
    handled differently) attempts to do the
      for (i = 0; i < len; ++i)
        {
          conversion *sub = subconvs[i];
          if (sub->rank > t->rank)
            t->rank = sub->rank;
          if (sub->user_conv_p)
            t->user_conv_p = true;
          if (sub->bad_p)
            t->bad_p = true;
        }
    rank/user_conv_p/bad_p merging, but I mistyped the index, the loop
    iterates with j iterator and i is subconvs index, so the loop effectively
    doesn't do anything interesting except for merging from one of the
    subsubconvs element, if lucky within the subsubconvs array, if unlucky
    not even from inside of the array.

    The following patch fixes that.

    2025-04-03  Andrew Pinski  <quic_apin...@quicinc.com>
                Jakub Jelinek  <ja...@redhat.com>

            PR c++/119563
            * call.cc (build_list_conv): Fix a typo in loop gathering
            summary information from subsubconvs.

            * g++.dg/cpp0x/pr119563.C: New test.
            * g++.dg/cpp/embed-26.C: New test.

Reply via email to