PR libstdc++/85818 ensure path::preferred_separator is defined
authorJonathan Wakely <jwakely@redhat.com>
Thu, 17 May 2018 15:36:25 +0000 (16:36 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 17 May 2018 15:36:25 +0000 (16:36 +0100)
commit079638f924714afcadca5e44fdd9248ef00ff434
tree6f385b751a3f67c36a37e494ce90641cd2660a50
parentff03245e00af4448173fb5c11420876345e832f3
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.

From-SVN: r260326
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/path.cc
libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc [new file with mode: 0644]