PR libstdc++/85818 ensure path::preferred_separator is defined
commit013cef2c5ad96282cd476a2614bd4fb55c67a111
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 May 2018 15:36:25 +0000 (17 15:36 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 17 May 2018 15:36:25 +0000 (17 15:36 +0000)
tree6f385b751a3f67c36a37e494ce90641cd2660a50
parent0de89a9c08cc0e0b2ab5267b90c4d87ead371780
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@260326 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc [new file with mode: 0644]