]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Handle RAW_DATA_CST in add_list_candidates [PR118532]
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Jan 2025 08:12:21 +0000 (09:12 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 21 Jan 2025 08:12:21 +0000 (09:12 +0100)
commit843ca8a964bcfeae72d9d48e2dd549fa818120e3
tree2ee2b3f765e50fe4de1996065e715610fa88702a
parentd559fbab6123e2f8bfaeb3672f921bf53a00dba6
c++: Handle RAW_DATA_CST in add_list_candidates [PR118532]

This is the second bug discovered today with the
https://gcc.gnu.org/pipermail/gcc-patches/2025-January/673945.html
hack but then turned into proper testcases where embed-2[23].C FAILed
since introduction of optimized #embed support and the others when
optimizing large C++ initializers using RAW_DATA_CST.

The add_list_candidates problem is the same as with
make_tree_vector_from_ctor, unfortunately it can't call that
function because it can have those additional artificial arguments
that need to be pushed earlier.
When working on the patch, I've also noticed an error where we didn't
know how to dump RAW_DATA_CST, so I've added support for that too.

2025-01-21  Jakub Jelinek  <jakub@redhat.com>

PR c++/118532
* call.cc (add_list_candidates): Handle RAW_DATA_CST among init_list
elts.
* error.cc (dump_expr_init_vec): Handle RAW_DATA_CST among v elts.

* g++.dg/cpp/embed-22.C: New test.
* g++.dg/cpp/embed-23.C: New test.
* g++.dg/cpp0x/pr118532.C: New test.
* g++.dg/cpp2a/explicit20.C: New test.
gcc/cp/call.cc
gcc/cp/error.cc
gcc/testsuite/g++.dg/cpp/embed-22.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp/embed-23.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr118532.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/explicit20.C [new file with mode: 0644]