This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] PR libstdc++/85818 ensure path::preferred_separator is defined
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 21 May 2018 13:29:36 +0100
- Subject: Re: [PATCH] PR libstdc++/85818 ensure path::preferred_separator is defined
- References: <20180517153618.GA14041@redhat.com>
On 17/05/18 16:36 +0100, Jonathan Wakely wrote:
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.
Tested powerpc64le-linux, committed to trunk. Backport to gcc-8 to
follow.
I forgot to make the new test depend on the Filesystem lib being
supported. Fixed by this patch, committed to trunk and gcc-8-branch.
commit 3eb1acc290b7b7407a24b62a3d267f344e88ffbd
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Mon May 21 13:23:30 2018 +0100
PR libstdc++/85818 make new test require Filesystem support
PR libstdc++/85818
* testsuite/experimental/filesystem/path/preferred_separator.cc: Add
dg-require-filesystem-ts.
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc b/libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc
index b470e312bb1..5ca948dfaef 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/path/preferred_separator.cc
@@ -17,6 +17,7 @@
// { dg-options "-O0 -lstdc++fs -std=gnu++11" }
// { dg-do link { target c++11 } }
+// { dg-require-filesystem-ts "" }
#include <experimental/filesystem>