From patchwork Fri Feb 4 23:57:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1588644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=o63PRZBG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JrCCR2B25z9sFr for ; Sat, 5 Feb 2022 10:57:55 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CE4F83858C2C for ; Fri, 4 Feb 2022 23:57:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CE4F83858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1644019072; bh=TwRYrQvV4RRBDIlUS98F/I1h/P6owCKdnn7Oy+3iT14=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=o63PRZBGV9fVfkMBOTkjlktPw2yzUpQvJUwBRdOcFKC2JUm7nX4fFDSEW48U28Fgd iDr1Jty+juOI8B22QE+r+FYTR1xuzz1BEHXeVM3bhFMQlDC9u3YgDjtpqKinrEkFUG e69BppYiNFKgh1bXesk+ISfTHgntd4sAgPmYVuiM= 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.129.124]) by sourceware.org (Postfix) with ESMTPS id A27363858D28 for ; Fri, 4 Feb 2022 23:57:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A27363858D28 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-GnwuYWTkNt22KYf05H9Q8g-1; Fri, 04 Feb 2022 18:57:09 -0500 X-MC-Unique: GnwuYWTkNt22KYf05H9Q8g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2E4D18397A7; Fri, 4 Feb 2022 23:57:08 +0000 (UTC) Received: from localhost (unknown [10.33.37.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id A17379087; Fri, 4 Feb 2022 23:57:08 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Remove un-implementable noexcept from Filesystem TS operations Date: Fri, 4 Feb 2022 23:57:07 +0000 Message-Id: <20220204235707.2710974-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.6 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Tested powerpc64le-linux, pushed to trunk. LWG 3014 removed these incorrect noexcept specifications from the C++17 std::filesystem operations. They are also incorrect on the experimental TS versions and should be removed from them too. libstdc++-v3/ChangeLog: * include/experimental/bits/fs_ops.h (fs::copy_file): Remove noexcept. (fs::create_directories): Likewise. (fs::remove_all): Likewise. * src/filesystem/ops.cc (fs::copy_file): Remove noexcept. (fs::create_directories): Likewise. (fs::remove_all): Likewise. --- libstdc++-v3/include/experimental/bits/fs_ops.h | 8 ++++---- libstdc++-v3/src/filesystem/ops.cc | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/fs_ops.h b/libstdc++-v3/include/experimental/bits/fs_ops.h index 6e475306c23..dafd1ec79a0 100644 --- a/libstdc++-v3/include/experimental/bits/fs_ops.h +++ b/libstdc++-v3/include/experimental/bits/fs_ops.h @@ -74,19 +74,19 @@ inline namespace v1 { return copy_file(__from, __to, copy_options::none); } inline bool - copy_file(const path& __from, const path& __to, error_code& __ec) noexcept + copy_file(const path& __from, const path& __to, error_code& __ec) { return copy_file(__from, __to, copy_options::none, __ec); } bool copy_file(const path& __from, const path& __to, copy_options __option); bool copy_file(const path& __from, const path& __to, copy_options __option, - error_code& __ec) noexcept; + error_code& __ec); void copy_symlink(const path& __existing_symlink, const path& __new_symlink); void copy_symlink(const path& __existing_symlink, const path& __new_symlink, error_code& __ec) noexcept; bool create_directories(const path& __p); - bool create_directories(const path& __p, error_code& __ec) noexcept; + bool create_directories(const path& __p, error_code& __ec); bool create_directory(const path& __p); bool create_directory(const path& __p, error_code& __ec) noexcept; @@ -262,7 +262,7 @@ inline namespace v1 bool remove(const path& __p, error_code& __ec) noexcept; uintmax_t remove_all(const path& __p); - uintmax_t remove_all(const path& __p, error_code& __ec) noexcept; + uintmax_t remove_all(const path& __p, error_code& __ec); void rename(const path& __from, const path& __to); void rename(const path& __from, const path& __to, error_code& __ec) noexcept; diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index c020f621a88..e2a2cefdf49 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -372,7 +372,7 @@ fs::copy_file(const path& from, const path& to, copy_options option) bool fs::copy_file(const path& from, const path& to, copy_options options, - error_code& ec) noexcept + error_code& ec) { #ifdef _GLIBCXX_HAVE_SYS_STAT_H return do_copy_file(from.c_str(), to.c_str(), copy_file_options(options), @@ -424,7 +424,7 @@ fs::create_directories(const path& p) } bool -fs::create_directories(const path& p, error_code& ec) noexcept +fs::create_directories(const path& p, error_code& ec) { if (p.empty()) { @@ -1098,7 +1098,7 @@ fs::remove_all(const path& p) } std::uintmax_t -fs::remove_all(const path& p, error_code& ec) noexcept +fs::remove_all(const path& p, error_code& ec) { // Use the C++17 implementation. return std::filesystem::remove_all(p.native(), ec);