From patchwork Mon Apr 11 14:54:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1615775 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=WBs7M8Be; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4KcX3V0hxlz9sBy for ; Tue, 12 Apr 2022 00:55:50 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CDCAE383F030 for ; Mon, 11 Apr 2022 14:55:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CDCAE383F030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1649688947; bh=5e2KkPYQVeUv1V9owvMO5Sq828EOGykGHYG1k83Ydpg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=WBs7M8Be6/y59iruKGdfWZgYHijaCVWaNMBQVHFWbHUBbHRY/X0BxZZF2v0uopfd+ K2FDzY+0tdL+e9amVIT6nJjBsAL54rrR8XZdHtiBQtSN7H457BizGV9SlfEhkRi4YN sXMQ1iZSLqOOaB1avyJsSSdtIZclMFmhEYxAN0Eg= 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 571B63851C07 for ; Mon, 11 Apr 2022 14:54:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 571B63851C07 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-195-i2EhGhDeMVSD0o4ftv4Eig-1; Mon, 11 Apr 2022 10:54:09 -0400 X-MC-Unique: i2EhGhDeMVSD0o4ftv4Eig-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E4112A59561; Mon, 11 Apr 2022 14:54:09 +0000 (UTC) Received: from localhost (unknown [10.33.36.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A45F40BB3F; Mon, 11 Apr 2022 14:54:09 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Move Filesystem TS path definitions out of class body Date: Mon, 11 Apr 2022 15:54:08 +0100 Message-Id: <20220411145408.76186-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.7 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, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 x86_64-linux, pushed to trunk. -- >8 -- This fixes some errors with clang caused by instantiating vector<_Cmpt> before the _Cmpt type is complete. libstdc++-v3/ChangeLog: * include/experimental/bits/fs_path.h (path): Define special members after path::_Cmpt is complete. --- .../include/experimental/bits/fs_path.h | 59 ++++++++++++------- 1 file changed, 38 insertions(+), 21 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index 803df424664..b0825ba76e8 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -212,21 +212,11 @@ namespace __detail // constructors and destructor - path() noexcept { } + path() noexcept; + path(const path& __p); + path(path&& __p) noexcept; - path(const path& __p) = default; - - path(path&& __p) noexcept - : _M_pathname(std::move(__p._M_pathname)), _M_type(__p._M_type) - { - if (_M_type == _Type::_Multi) - _M_split_cmpts(); - __p.clear(); - } - - path(string_type&& __source) - : _M_pathname(std::move(__source)) - { _M_split_cmpts(); } + path(string_type&& __source); template> @@ -256,11 +246,11 @@ namespace __detail : _M_pathname(_S_convert_loc(__first, __last, __loc)) { _M_split_cmpts(); } - ~path() = default; + ~path(); // assignments - path& operator=(const path& __p) = default; + path& operator=(const path& __p); path& operator=(path&& __p) noexcept; path& operator=(string_type&& __source); path& assign(string_type&& __source); @@ -449,11 +439,7 @@ namespace __detail _Multi, _Root_name, _Root_dir, _Filename }; - path(string_type __str, _Type __type) : _M_pathname(__str), _M_type(__type) - { - __glibcxx_assert(!empty()); - __glibcxx_assert(_M_type != _Type::_Multi); - } + path(string_type __str, _Type __type); enum class _Split { _Stem, _Extension }; @@ -908,6 +894,37 @@ namespace __detail bool _M_at_end; // only used when type != _Multi }; + inline + path::path() noexcept = default; + + inline + path::path(const path&) = default; + + inline + path::path(path&& __p) noexcept + : _M_pathname(std::move(__p._M_pathname)), + _M_cmpts(__p._M_cmpts), + _M_type(__p._M_type) + { __p.clear(); } + + inline + path::path(string_type&& __source) + : _M_pathname(std::move(__source)) + { _M_split_cmpts(); } + + inline + path::path(string_type __str, _Type __type) + : _M_pathname(__str), _M_type(__type) + { + __glibcxx_assert(!empty()); + __glibcxx_assert(_M_type != _Type::_Multi); + } + + inline + path::~path() = default; + + inline path& + path::operator=(const path& __p) = default; inline path& path::operator=(path&& __p) noexcept