From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 429F23858428; Thu, 2 Feb 2023 16:47:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 429F23858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675356470; bh=RlyRd6/17SkrD2YX/2cw2KA/Iz/gnFcRYbcUpoHaXVI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ODxrvbTA8pjsbzzADBEr4D2ezts8fxXDutcGqSdQ6oKe8+Hk6+d15CknI0d9zRe8W uLwoou6TVUBVPBiceX28nLguO6Xw0eDIm/m/nDBI/vhek8Ihgspidi0sdAAavHZ53l kSXuc/7n03D/eRdJ4o6J7taej+Fg0joTMfvOD79s= From: "cvs-commit 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 16:47:50 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 --- Comment #3 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:db8d6fc572ec316ccfcf70b1dffe3be0b1b37212 commit r13-5662-gdb8d6fc572ec316ccfcf70b1dffe3be0b1b37212 Author: Jonathan Wakely Date: Thu Feb 2 14:06:40 2023 +0000 libstdc++: Fix std::filesystem errors with -fkeep-inline-functions [PR108636] With -fkeep-inline-functions there are linker errors when including . This happens because there are some filesystem::path constructors defined inline which call non-exported functions defined in the library. That's usually not a problem, because those constructors are only called by code that's also inside the library. But when the header is compiled with -fkeep-inline-functions those inline functions are emitted even though they aren't called. That then creates an undefined reference to the other library internsl. The fix is to just move the private constructors into the library where they are called. That way they are never even seen by users, and so not compiled even if -fkeep-inline-functions is used. On trunk there is a second problem, which is that the new equality operators for comparing directory iterators with default_sentinel use the shared_ptr::operator bool() conversion operator. The shared_ptr specializations used by directory iterators are explicitly instantiated in the library, but the bool conversion operators are not exported. This causes linker errors at -O0 or with -fkeep-inline-functions. That just requires the conversion operators to be exported. libstdc++-v3/ChangeLog: PR libstdc++/108636 * config/abi/pre/gnu.ver (GLIBCXX_3.4.31): Export shared_ptr conversion operators for directory iterator comparisons with std::default_sentinel_t. * include/bits/fs_path.h (path::path(string_view, _Type)) (path::_Cmpt::_Cmpt(string_view, _Type, size_t)): Move inline definitions to ... * src/c++17/fs_path.cc: ... here. * testsuite/27_io/filesystem/path/108636.cc: New test.=