From patchwork Fri May 17 12:47:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1936422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZePQ1QU7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vgmwh2qYHz20dJ for ; Fri, 17 May 2024 22:48:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E9313849AD3 for ; Fri, 17 May 2024 12:48:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id E90A93858415 for ; Fri, 17 May 2024 12:48:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E90A93858415 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E90A93858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715950088; cv=none; b=HE2QoGExhLHt6r5Nz5666/cIPGf583AQhvCF6/qVsM+8LMYAQxqYlgUZoYCYZVJIk2Wh4k71f+dsv8czUyHdislBmgqsQ+x9koqmUCGwtRrWlEVRiVcvpBzVYU6Mv94BWCsDrCvBZmRxfaMqNGnH42uyW3uiN291/FOC7fOgLbo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715950088; c=relaxed/simple; bh=H+YPt/VARI8imrfztUkKLWb7GghPNGjaLJU6noayp14=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KReNWCGU4xTYNeUvdl7oXfQfbZSgglPMCiZV7Ster2hWJ5F28vPQ3oLfol44JnVAeH/CL/X5KmOD8Ao+qYJ0m8NTCGW1kvGP7oXdzoi3tLbpYtE8CCOSjcQRk4rOb6+QgyYtvcKNHkEfkemhzolnCl0SW6Ddoc+1uFon7MoRsJ4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715950086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Vuuw12lyyF+RhpeEmA2f1kitOwKyGuWTOBVBFqzLEOE=; b=ZePQ1QU7bPwjiWu2ZV7dbZUpmGWABAY9UZhY7d61Cj7wd+C2NMyxgf1N3Z1+JA54mUSAe8 1dOmpAZDUrBhbNg0kN7kCEmu6/E/UT3YK71uAsjTgOOcoEu1F1h83fVpLbJJW7B7FaEqq9 3en80P2tj6IkBMPpJ9maOnYFiUCu4WM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-zwCmikzLO9-X3DgqGiAUWA-1; Fri, 17 May 2024 08:48:03 -0400 X-MC-Unique: zwCmikzLO9-X3DgqGiAUWA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 26558802079; Fri, 17 May 2024 12:48:03 +0000 (UTC) Received: from localhost (unknown [10.42.28.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA3BD1C00A8F; Fri, 17 May 2024 12:48:02 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator [PR115119] Date: Fri, 17 May 2024 13:47:10 +0100 Message-ID: <20240517124802.789016-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. Pushed to trunk, gcc-14 backport to follow. -- >8 -- libstdc++-v3/ChangeLog: PR libstdc++/115119 * include/bits/unicode.h (_Iterator::operator++(int)): Fix typo in increment expression. * testsuite/ext/unicode/grapheme_view.cc: Check post-increment on view's iterator. --- libstdc++-v3/include/bits/unicode.h | 6 ++++-- libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h index 46238143fb6..a14a17c5dfc 100644 --- a/libstdc++-v3/include/bits/unicode.h +++ b/libstdc++-v3/include/bits/unicode.h @@ -34,10 +34,12 @@ #include #include // bit_width #include // __detail::__from_chars_alnum_to_val_table +#include #include #include #include -#include +#include // iterator_t, sentinel_t, input_range, etc. +#include // view_interface namespace std _GLIBCXX_VISIBILITY(default) { @@ -802,7 +804,7 @@ inline namespace __v15_1_0 operator++(int) { auto __tmp = *this; - ++this; + ++*this; return __tmp; } diff --git a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc index ac1e8c50b05..a3bb36e14b8 100644 --- a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc +++ b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc @@ -83,10 +83,21 @@ test_breaks() VERIFY( iter == gv.end() ); } +constexpr void +test_pr115119() +{ + // PR 115119 Typo in _Grapheme_cluster_view::_Iterator::operator++(int) + uc::_Grapheme_cluster_view gv(" "sv); + auto it = std::ranges::begin(gv); + it++; + VERIFY( it == std::ranges::end(gv) ); +} + int main() { auto run_tests = []{ test_breaks(); + test_pr115119(); return true; };