diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver index 72716414ccb..34f23bcbce0 100644 --- a/libstdc++-v3/config/abi/pre/gnu.ver +++ b/libstdc++-v3/config/abi/pre/gnu.ver @@ -2504,6 +2504,13 @@ GLIBCXX_3.4.31 { _ZNSt6chrono9tzdb_list14const_iteratorppEi; _ZN9__gnu_cxx21zoneinfo_dir_overrideEv; + # __shared_ptr::operator bool() + _ZNKSt12__shared_ptrINSt10filesystem4_DirELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv; + _ZNKSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv; + # __shared_ptr::operator bool() + _ZNKSt12__shared_ptrINSt10filesystem28recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv; + _ZNKSt12__shared_ptrINSt10filesystem7__cxx1128recursive_directory_iterator10_Dir_stackELN9__gnu_cxx12_Lock_policyE[012]EEcvbEv; + } GLIBCXX_3.4.30; # Symbols in the support library (libsupc++) have their own tag. 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 = 0, _Root_name, _Root_dir, _Filename }; - path(basic_string_view __str, _Type __type) - : _M_pathname(__str) - { - __glibcxx_assert(__type != _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 != _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 = _Cmpt; diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/108636.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/108636.cc new file mode 100644 index 00000000000..d58de461090 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/filesystem/path/108636.cc @@ -0,0 +1,8 @@ +// { dg-do link { target c++17 } } +// { dg-options "-fkeep-inline-functions" } + +#include +int main() +{ + // PR libstdc++/108636 - link failure with -fkeep-inline-functions +}