public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/108636] C++20 undefined reference to `std::filesystem::__cxx11::path::_List::type(std::filesystem::__cxx11::path::_Type)' with -fkeep-inline-functions Date: Thu, 02 Feb 2023 16:47:50 +0000 [thread overview] Message-ID: <bug-108636-4-SeWoSOHiMT@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108636-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108636 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:db8d6fc572ec316ccfcf70b1dffe3be0b1b37212 commit r13-5662-gdb8d6fc572ec316ccfcf70b1dffe3be0b1b37212 Author: Jonathan Wakely <jwakely@redhat.com> 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 <filesystem>. 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.
next prev parent reply other threads:[~2023-02-02 16:47 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-02 12:03 [Bug c++/108636] New: C++20 to " hnc at singularity dot fr 2023-02-02 12:11 ` [Bug libstdc++/108636] " redi at gcc dot gnu.org 2023-02-02 13:25 ` [Bug libstdc++/108636] C++20 " redi at gcc dot gnu.org 2023-02-02 13:46 ` redi at gcc dot gnu.org 2023-02-02 16:47 ` cvs-commit at gcc dot gnu.org [this message] 2023-02-02 17:12 ` [Bug libstdc++/108636] [10/11/12 Regression] " redi at gcc dot gnu.org 2023-02-21 0:48 ` cvs-commit at gcc dot gnu.org 2023-03-16 16:51 ` [Bug libstdc++/108636] [10/11 " cvs-commit at gcc dot gnu.org 2023-03-16 17:53 ` [Bug libstdc++/108636] [10 " cvs-commit at gcc dot gnu.org 2023-03-16 17:54 ` redi at gcc dot gnu.org 2024-01-31 22:23 ` Mark_B53 at yahoo dot com 2024-02-01 18:36 ` redi at gcc dot gnu.org 2024-02-02 10:35 ` cvs-commit at gcc dot gnu.org 2024-02-02 10:40 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108636-4-SeWoSOHiMT@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).