From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 788E13858C74; Thu, 2 Feb 2023 13:46:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 788E13858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675345613; bh=cBvWJ5ZQ2Hro9jOmlyBqHe57hEQgZMpZ6oXERTU3Jtc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=g/TCB77be3UkYG2RxOaMQ3FU4Zu7NOEmXZPL/m0KavzWDo8zeUjgcqMMrEWRpcMC9 wQ5rUt10yIhpzSbHazoC0RJKl7C82bidvUTyanovW74gJFpOaPQkcLlaqMgt9qgBx7 yICefGJV3gAtHidcD4ySbxkttmb5mtxET2A74ERw= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBsaWJzdGRjKysvMTA4NjM2XSBDKysyMCB1bmRlZmluZWQg?= =?UTF-8?B?cmVmZXJlbmNlIHRvIGBzdGQ6OmZpbGVzeXN0ZW06Ol9fY3h4MTE6OnBhdGg6?= =?UTF-8?B?Ol9MaXN0Ojp0eXBlKHN0ZDo6ZmlsZXN5c3RlbTo6X19jeHgxMTo6cGF0aDo6?= =?UTF-8?B?X1R5cGUpJyB3aXRoIC1ma2VlcC1pbmxpbmUtZnVuY3Rpb25z?= Date: Thu, 02 Feb 2023 13:46:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108636 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #2 from Jonathan Wakely --- The problem with path::_List::type(_Type) is that it's only ever used by a private constructor of path, which is only ever called from within the libr= ary. But when you use -fkeep-inline-functions that private constructor gets comp= iled into your code even though you don't (and can't) ever use it. The fix is to move the definitions of those private constructors into the library too, so that they aren't compiled into your code even with -fkeep-inline-functions. diff --git a/libstdc++-v3/include/bits/fs_path.h b/libstdc++-v3/include/bits/fs_path.h index 1cbfaaa5427..0d7bb10c1a0 100644 --- a/libstdc++-v3/include/bits/fs_path.h +++ b/libstdc++-v3/include/bits/fs_path.h @@ -596,12 +596,7 @@ namespace __detail _Multi =3D 0, _Root_name, _Root_dir, _Filename }; - path(basic_string_view __str, _Type __type) - : _M_pathname(__str) - { - __glibcxx_assert(__type !=3D _Type::_Multi); - _M_cmpts.type(__type); - } + path(basic_string_view __str, _Type __type); enum class _Split { _Stem, _Extension }; @@ -851,8 +846,7 @@ namespace __detail struct path::_Cmpt : path { - _Cmpt(basic_string_view __s, _Type __t, size_t __pos) - : path(__s, __t), _M_pos(__pos) { } + _Cmpt(basic_string_view __s, _Type __t, size_t __pos); _Cmpt() : _M_pos(-1) { } diff --git a/libstdc++-v3/src/c++17/fs_path.cc b/libstdc++-v3/src/c++17/fs_path.cc index 93149c4b415..aaea7d2725d 100644 --- a/libstdc++-v3/src/c++17/fs_path.cc +++ b/libstdc++-v3/src/c++17/fs_path.cc @@ -187,6 +187,19 @@ struct path::_Parser { return origin + c.str.data() - input.data(); } }; +inline +path::path(basic_string_view __str, _Type __type) +: _M_pathname(__str) +{ + __glibcxx_assert(__type !=3D _Type::_Multi); + _M_cmpts.type(__type); +} + +inline +path::_Cmpt::_Cmpt(basic_string_view __s, _Type __t, size_t __= pos) +: path(__s, __t), _M_pos(__pos) +{ } + struct path::_List::_Impl { using value_type =3D _Cmpt; The good news is this doesn't have any ABI impact, so can be backported to = the release branches. For the other undefined symbols noted in comment 1, those require new symbo= ls to be exported from the library. The good news there is that the comparisons with default_sentinel_t are new in GCC 13 and so we don't need to backport anything.=