From patchwork Fri Jun 9 08:56:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 105441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp805261vqr; Fri, 9 Jun 2023 01:58:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7lsRLOi5zJvX/5gCRTe5s15TQ++tyx9/FDj4PjZwSGRVBhGR71fbXl2i/Ty0kDTNLOC/yM X-Received: by 2002:a17:907:36c7:b0:973:e69d:c720 with SMTP id bj7-20020a17090736c700b00973e69dc720mr1026000ejc.51.1686301084233; Fri, 09 Jun 2023 01:58:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686301084; cv=none; d=google.com; s=arc-20160816; b=KaNtf8rk8lcgHRs4gBrcCZo1kxDe/ReS5MkbwebjNm6o4fM2DtJ/d/ESD/EXhKXmea sXwVDlpDapUkc16ZE+m+wigXLKVYpK5hcNJ6zsq4ldkU+1h+cmZ7mr2mE1go+0TUkprN Pd4GDO2ppnSC6N4w/5ON6/m8hZFYYgK5IP2Mf6UE8To6BEeazXnhCtqjEpCsaDUkK/VS /NB0E+yC7/dBw0318Oq4I0u5qy7bRV6IxzztM7kNlCiANwUpLqqonWsaqOinC9xaHaDN bjUHOEPZO4oIm2JA3MTEULMBHniDRVfEnNIwei4zwtjV2RxiYltl8pDqSzLJ+Ft1m2aG QLRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=U2ONEQ3ZbyvNR1GUivoInjiGQXjpxPOYfevavl563SA=; b=l5uGegWmsybnIlKsoCNh/JWG/Yf7v3vTpIyTg0ymrIE6H3hRcNFcbWow5XQLVpVi5C 5i5frK1KgQ9E80QOX31+N5IF5ccP2dyRnpuLCTjCqqAvx802f7RqKry+lLKeZZ+ECdZv pNuB7ZCiwXKW37ILsgfVpfrW7w591Q43PUyQRLvwBBNjhbg8IiXnT4PnLPqYeQGS0In1 6e2UFCkZl9NNYVB0iJ1e3O4ArUVVX3eE7bnEr5nClWBwTnrK5nNSYeEDd/ag1XezeCd8 rEnmfZ4jG5XVBQ4t+HukYX/5g2wjKGo+oQxsw0MAtBCOWVjtKJiKoc1R+4hs5nDxCbld sh2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XIURsPDq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id x9-20020a170906296900b00977ebc42984si1117650ejd.575.2023.06.09.01.58.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 01:58:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XIURsPDq; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8461E385B524 for ; Fri, 9 Jun 2023 08:57:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8461E385B524 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686301069; bh=U2ONEQ3ZbyvNR1GUivoInjiGQXjpxPOYfevavl563SA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=XIURsPDqIeWH/OmwetCbmBRYHD58nMcAPtv8pMEIZR+YWxHL/vPZePSK6a8Ry0O21 Dn8SeyFJuA06dE9FjGUft+A4wz7Er3NSnT+WoNXOa8Iy38jFWI3tVzQI4hcPlC8vLT OZGxABDJL2j7/uEDAg/F7V7dgjvk+Jq0p9rWSIFU= 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 21E9E3858D1E for ; Fri, 9 Jun 2023 08:56:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 21E9E3858D1E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-308-LQya5XG1MrKhI3RAywFFig-1; Fri, 09 Jun 2023 04:56:50 -0400 X-MC-Unique: LQya5XG1MrKhI3RAywFFig-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44A25801182; Fri, 9 Jun 2023 08:56:50 +0000 (UTC) Received: from localhost (unknown [10.42.28.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id 27AB840D1B66; Fri, 9 Jun 2023 08:56:49 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Improve tests for emplace member of sequence containers Date: Fri, 9 Jun 2023 09:56:47 +0100 Message-Id: <20230609085647.208295-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768214845950446550?= X-GMAIL-MSGID: =?utf-8?q?1768214845950446550?= I'm fairly confident these emplace member functions work correctly, but it's still nice to actually test them! Tested powerpc64le-linux. Pushed to trunk. -- >8 -- Our existing tests for std::deque::emplace, std::list::emplace and std::vector::emplace are poor. We only have compile tests for PR 52799 and the equivalent for a const_iterator as the insertion point. This fails to check that the value is actually inserted correctly and the right iterator is returned. Add new tests that cover the existing 52799.cc and const_iterator.cc compile-only tests, as well as verifying the effects are correct. libstdc++-v3/ChangeLog: * testsuite/23_containers/deque/modifiers/emplace/52799.cc: Removed. * testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc: Removed. * testsuite/23_containers/list/modifiers/emplace/52799.cc: Removed. * testsuite/23_containers/list/modifiers/emplace/const_iterator.cc: Removed. * testsuite/23_containers/vector/modifiers/emplace/52799.cc: Removed. * testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc: Removed. * testsuite/23_containers/deque/modifiers/emplace/1.cc: New test. * testsuite/23_containers/list/modifiers/emplace/1.cc: New test. * testsuite/23_containers/vector/modifiers/emplace/1.cc: New test. --- .../deque/modifiers/emplace/1.cc | 70 ++++++++++++++++++ .../deque/modifiers/emplace/52799.cc | 27 ------- .../deque/modifiers/emplace/const_iterator.cc | 26 ------- .../23_containers/list/modifiers/emplace/1.cc | 71 +++++++++++++++++++ .../list/modifiers/emplace/52799.cc | 27 ------- .../list/modifiers/emplace/const_iterator.cc | 26 ------- .../vector/modifiers/emplace/1.cc | 70 ++++++++++++++++++ .../vector/modifiers/emplace/52799.cc | 27 ------- .../modifiers/emplace/const_iterator.cc | 26 ------- 9 files changed, 211 insertions(+), 159 deletions(-) create mode 100644 libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/1.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc create mode 100644 libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/1.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc create mode 100644 libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/1.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/1.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/1.cc new file mode 100644 index 00000000000..c6b0318e5ea --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/1.cc @@ -0,0 +1,70 @@ +// { dg-do run { target c++11 } } + +#include +#include + +void +test01() +{ + std::deque c; + std::deque::iterator pos; + + // libstdc++/52799 + pos = c.emplace(c.begin()); + VERIFY( c.size() == 1 ); + VERIFY( c[0] == 0 ); + VERIFY( pos == c.begin() ); + pos = c.emplace(c.begin(), 2); + VERIFY( c.size() == 2 ); + VERIFY( c[0] == 2 ); + VERIFY( c[1] == 0 ); + VERIFY( pos == c.begin() ); + pos = c.emplace(c.end(), 3); + VERIFY( c.size() == 3 ); + VERIFY( c[0] == 2 ); + VERIFY( c[1] == 0 ); + VERIFY( c[2] == 3 ); + VERIFY( pos == --c.end() ); + + // const_iterator + pos = c.emplace(c.cbegin()); + VERIFY( c.size() == 4 ); + VERIFY( c[0] == 0 ); + VERIFY( c[1] == 2 ); + VERIFY( pos == c.cbegin() ); + pos = c.emplace(c.cbegin() + 2, 22); + VERIFY( c.size() == 5 ); + VERIFY( c[0] == 0 ); + VERIFY( c[1] == 2 ); + VERIFY( c[2] == 22 ); + VERIFY( pos == c.cbegin() + 2 ); +} + +struct V +{ + explicit V(int a, int b = 0) : val(a+b) { } + int val; +}; + +void +test02() +{ + std::deque c; + std::deque::iterator pos; + + pos = c.emplace(c.end(), 1); + VERIFY( c.size() == 1 ); + VERIFY( c[0].val == 1 ); + VERIFY( pos == --c.end() ); + pos = c.emplace(c.cend(), 2, 3); + VERIFY( c.size() == 2 ); + VERIFY( c[0].val == 1 ); + VERIFY( c[1].val == 5 ); + VERIFY( pos == --c.cend() ); +} + +int main() +{ + test01(); + test02(); +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc deleted file mode 100644 index 0beebb58248..00000000000 --- a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/52799.cc +++ /dev/null @@ -1,27 +0,0 @@ -// { dg-do compile { target c++11 } } - -// Copyright (C) 2012-2023 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -// libstdc++/52799 -int main() -{ - std::deque d; - d.emplace(d.begin()); -} diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc deleted file mode 100644 index 81d1614a407..00000000000 --- a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc +++ /dev/null @@ -1,26 +0,0 @@ -// { dg-do compile { target c++11 } } - -// Copyright (C) 2013-2023 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void test01() -{ - std::deque d1; - d1.emplace(d1.cbegin(), 1); -} diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/1.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/1.cc new file mode 100644 index 00000000000..8f14c15d7a1 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/1.cc @@ -0,0 +1,71 @@ +// { dg-do run { target c++11 } } + +#include +#include + +void +test01() +{ + std::list c; + std::list::iterator pos; + + // libstdc++/52799 + pos = c.emplace(c.begin()); + VERIFY( c.size() == 1 ); + VERIFY( *pos == 0 ); + VERIFY( pos == c.begin() ); + pos = c.emplace(c.begin(), 2); + VERIFY( c.size() == 2 ); + VERIFY( *pos == 2 ); + VERIFY( pos == c.begin() ); + VERIFY( *++pos == 0 ); + pos = c.emplace(c.end(), 3); + VERIFY( c.size() == 3 ); + VERIFY( *pos == 3 ); + VERIFY( pos == --c.end() ); + VERIFY( *--pos == 0 ); + VERIFY( *--pos == 2 ); + + // const_iterator + pos = c.emplace(c.cbegin()); + VERIFY( c.size() == 4 ); + VERIFY( *pos == 0 ); + VERIFY( pos == c.cbegin() ); + VERIFY( *++pos == 2 ); + std::list::const_iterator i = std::next(c.cbegin(), 2); + pos = c.emplace(i, 22); + VERIFY( c.size() == 5 ); + VERIFY( *pos == 22 ); + VERIFY( pos == std::prev(i) ); + VERIFY( *--pos == 2 ); + VERIFY( *--pos == 0 ); +} + +struct V +{ + explicit V(int a, int b = 0) : val(a+b) { } + int val; +}; + +void +test02() +{ + std::list c; + std::list::iterator pos; + + pos = c.emplace(c.end(), 1); + VERIFY( c.size() == 1 ); + VERIFY( pos->val == 1 ); + VERIFY( pos == --c.end() ); + pos = c.emplace(c.cend(), 2, 3); + VERIFY( c.size() == 2 ); + VERIFY( pos->val == 5 ); + VERIFY( pos == --c.cend() ); + VERIFY( c.front().val == 1 ); +} + +int main() +{ + test01(); + test02(); +} diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc deleted file mode 100644 index 8b768329974..00000000000 --- a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/52799.cc +++ /dev/null @@ -1,27 +0,0 @@ -// { dg-do compile { target c++11 } } - -// Copyright (C) 2012-2023 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -// libstdc++/52799 -int main() -{ - std::list l; - l.emplace(l.begin()); -} diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc deleted file mode 100644 index 7e620b8cc72..00000000000 --- a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc +++ /dev/null @@ -1,26 +0,0 @@ -// { dg-do compile { target c++11 } } - -// Copyright (C) 2013-2023 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void test01() -{ - std::list l1; - l1.emplace(l1.cbegin(), 1); -} diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/1.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/1.cc new file mode 100644 index 00000000000..53f3ebe02e4 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/1.cc @@ -0,0 +1,70 @@ +// { dg-do run { target c++11 } } + +#include +#include + +void +test01() +{ + std::vector c; + std::vector::iterator pos; + + // libstdc++/52799 + pos = c.emplace(c.begin()); + VERIFY( c.size() == 1 ); + VERIFY( c[0] == 0 ); + VERIFY( pos == c.begin() ); + pos = c.emplace(c.begin(), 2); + VERIFY( c.size() == 2 ); + VERIFY( c[0] == 2 ); + VERIFY( c[1] == 0 ); + VERIFY( pos == c.begin() ); + pos = c.emplace(c.end(), 3); + VERIFY( c.size() == 3 ); + VERIFY( c[0] == 2 ); + VERIFY( c[1] == 0 ); + VERIFY( c[2] == 3 ); + VERIFY( pos == --c.end() ); + + // const_iterator + pos = c.emplace(c.cbegin()); + VERIFY( c.size() == 4 ); + VERIFY( c[0] == 0 ); + VERIFY( c[1] == 2 ); + VERIFY( pos == c.cbegin() ); + pos = c.emplace(c.cbegin() + 2, 22); + VERIFY( c.size() == 5 ); + VERIFY( c[0] == 0 ); + VERIFY( c[1] == 2 ); + VERIFY( c[2] == 22 ); + VERIFY( pos == c.cbegin() + 2 ); +} + +struct V +{ + explicit V(int a, int b = 0) : val(a+b) { } + int val; +}; + +void +test02() +{ + std::vector c; + std::vector::iterator pos; + + pos = c.emplace(c.end(), 1); + VERIFY( c.size() == 1 ); + VERIFY( c[0].val == 1 ); + VERIFY( pos == --c.end() ); + pos = c.emplace(c.cend(), 2, 3); + VERIFY( c.size() == 2 ); + VERIFY( c[0].val == 1 ); + VERIFY( c[1].val == 5 ); + VERIFY( pos == --c.cend() ); +} + +int main() +{ + test01(); + test02(); +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc deleted file mode 100644 index d33c01164ba..00000000000 --- a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/52799.cc +++ /dev/null @@ -1,27 +0,0 @@ -// { dg-do compile { target c++11 } } - -// Copyright (C) 2012-2023 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -// libstdc++/52799 -int main() -{ - std::vector v; - v.emplace(v.begin()); -} diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc deleted file mode 100644 index 6fc7e327308..00000000000 --- a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc +++ /dev/null @@ -1,26 +0,0 @@ -// { dg-do compile { target c++11 } } - -// Copyright (C) 2013-2023 Free Software Foundation, Inc. -// -// This file is part of the GNU ISO C++ Library. This library is free -// software; you can redistribute it and/or modify it under the -// terms of the GNU General Public License as published by the -// Free Software Foundation; either version 3, or (at your option) -// any later version. - -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License along -// with this library; see the file COPYING3. If not see -// . - -#include - -void test01() -{ - std::vector v1; - v1.emplace(v1.cbegin(), 1); -}