瀏覽代碼

Add another workaround for C++17 inline variable ABI breakage.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@274408 91177308-0d34-0410-b5e6-96231b3b80d8
Eric Fiselier 9 年之前
父節點
當前提交
cd20679f5f
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/experimental/filesystem/path.cpp

+ 4 - 1
src/experimental/filesystem/path.cpp

@@ -13,7 +13,10 @@
 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
 
 _LIBCPP_CONSTEXPR path::value_type path::preferred_separator;
-
+// Make preferred_separator non-discardable in C++17
+// See PR28395 (https://llvm.org/bugs/show_bug.cgi?id=28395)
+static const path::value_type&
+    __preferred_sep_force_use __attribute__((used)) = path::preferred_separator;
 
 namespace { namespace parser
 {