[Bug libstdc++/85818] [8/9 Regression] undefined reference to `std::experimental::filesystem::v1::__cxx11::path::preferred_separator'
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 17 16:11:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85818
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Thu May 17 16:10:26 2018
New Revision: 260328
URL: https://gcc.gnu.org/viewcvs?rev=260328&root=gcc&view=rev
Log:
PR libstdc++/85818 ensure path::preferred_separator is defined
Because path.cc is compiled with -std=gnu++17 the static constexpr
data member is implicitly 'inline' and so no definition gets emitted
unless it gets used in that translation unit. Other translation units
built as C++11 or C++14 still require a namespace-scope definition of
the variable, so mark the definition as used.
PR libstdc++/85818
* src/filesystem/path.cc (path::preferred_separator): Add used
attribute.
* testsuite/experimental/filesystem/path/preferred_separator.cc: New.
Added:
branches/gcc-8-branch/libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc
Modified:
branches/gcc-8-branch/libstdc++-v3/ChangeLog
branches/gcc-8-branch/libstdc++-v3/src/filesystem/path.cc
More information about the Gcc-bugs
mailing list