From: Patrick Palka Date: Thu, 29 Oct 2020 14:11:12 +0000 (-0400) Subject: libstdc++: Fix memory issue in ranges::lexicographical_compare testcase X-Git-Tag: releases/gcc-10.3.0~711 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0b66a1831529b9887a3c97bcec5a95aeb6f1c13;p=thirdparty%2Fgcc.git libstdc++: Fix memory issue in ranges::lexicographical_compare testcase libstdc++-v3/ChangeLog: * testsuite/25_algorithms/lexicographical_compare/constrained.cc: (test03): Fix initializing the vector vy with the array y of size 4. (cherry picked from commit 2e0216f9c4db8fde09706f57e6a6d80161c0da07) --- diff --git a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc index b82c872bbbbe..2019bbc75e40 100644 --- a/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc +++ b/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/constrained.cc @@ -136,7 +136,7 @@ test03() VERIFY( !ranges::lexicographical_compare(cy.begin(), cy.end(), cz.begin(), cz.end()) ); - std::vector vx(x, x+5), vy(y, y+5); + std::vector vx(x, x+5), vy(y, y+4); VERIFY( ranges::lexicographical_compare(vx, vy) ); VERIFY( !ranges::lexicographical_compare(vx, vy, ranges::greater{}) ); VERIFY( !ranges::lexicographical_compare(vy, vx) );