On Wed, 26 Mar 2025 at 17:42, Jason Merrill <ja...@redhat.com> wrote: > > On 3/26/25 6:14 AM, Jonathan Wakely wrote: > > My r15-8904-ge200f53a555651 changed the std::vector initializer-list > > constructor so that it calls a new _M_range_initialize_n function > > instead of _M_range_initialize. Change the scan-tree-dump pattern in > > this g++.dg test to match the new gimple output. > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/tree-ssa/initlist-opt1.C: Match _M_range_initialize_n > > instead of _M_range_initialize. > > --- > > > > Would anybody prefer a different pattern? > > > > e.g. just {_M_range_initialize_n<const char\* const\*} without > > the second template argument and '>' would work, and would be correct > > for the gcc-14 backport where the new function only has one template > > parameter. > > That sounds most convenient to me. I don't think the specific signature > is important, as long as it checks that we use range-initialization from > const char *.
Agreed - so I've pushed the attached patch to trunk now, thanks.
commit 101f302363e8773958887e00750098b760a5b6bd Author: Jonathan Wakely <jwak...@redhat.com> AuthorDate: Wed Mar 26 10:10:19 2025 Commit: Jonathan Wakely <r...@gcc.gnu.org> CommitDate: Wed Mar 26 17:53:34 2025 c++: Fix FAIL: g++.dg/tree-ssa/initlist-opt1.C My r15-8904-ge200f53a555651 changed the std::vector initializer-list constructor so that it calls a new _M_range_initialize_n function instead of _M_range_initialize. Change the scan-tree-dump pattern in this g++.dg test to match the new gimple output. gcc/testsuite/ChangeLog: * g++.dg/tree-ssa/initlist-opt1.C: Match _M_range_initialize_n instead of _M_range_initialize. diff --git a/gcc/testsuite/g++.dg/tree-ssa/initlist-opt1.C b/gcc/testsuite/g++.dg/tree-ssa/initlist-opt1.C index 89abdd90a82..976c3f30b16 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/initlist-opt1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/initlist-opt1.C @@ -4,7 +4,7 @@ // { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } } // Test that we do range-initialization from const char *. -// { dg-final { scan-tree-dump {_M_range_initialize<const char\* const\*>} "gimple" } } +// { dg-final { scan-tree-dump {_M_range_initialize_n<const char\* const\*} "gimple" } } // { dg-final { scan-tree-dump {static const char.*72} "gimple" } } #include <string>