aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2015-10-02 20:38:38 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2015-10-02 20:38:38 +0100
commit7fcdbdd21d6adc14421bc8de439bf91b58eae6d1 (patch)
treeb5f3384755c093faaa1c510b9ac28d3738c27c76 /libstdc++-v3/src
parent43222a5ec8d80b39a3731194c2e960be50dde221 (diff)
downloadgcc-7fcdbdd21d6adc14421bc8de439bf91b58eae6d1.zip
gcc-7fcdbdd21d6adc14421bc8de439bf91b58eae6d1.tar.gz
gcc-7fcdbdd21d6adc14421bc8de439bf91b58eae6d1.tar.bz2
Allow Filesystem TS to compile without wchar_t
* include/bits/locale_conv.h [!_GLIBCXX_USE_WCHAR_T] (__do_str_codecvt, __str_codecvt_in, __str_codecvt_out): Enable. * include/experimental/fs_path.h [!_GLIBCXX_USE_WCHAR_T] (path::wstring, path::generic_wstring): Disable. * src/filesystem/path.cc (path::_S_convert_loc) [!_GLIBCXX_USE_WCHAR_T]: Skip conversion. * testsuite/experimental/filesystem/path/assign/assign.cc: Check for wchar_t support. * testsuite/experimental/filesystem/path/concat/strings.cc: Likewise. * testsuite/experimental/filesystem/path/construct/range.cc: Likewise. From-SVN: r228417
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r--libstdc++-v3/src/filesystem/path.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/src/filesystem/path.cc b/libstdc++-v3/src/filesystem/path.cc
index a5441b9..e85c9fc 100644
--- a/libstdc++-v3/src/filesystem/path.cc
+++ b/libstdc++-v3/src/filesystem/path.cc
@@ -437,8 +437,9 @@ path::_M_trim()
path::string_type
path::_S_convert_loc(const char* __first, const char* __last,
- const std::locale& __loc)
+ const std::locale& __loc)
{
+#if _GLIBCXX_USE_WCHAR_T
auto& __cvt = std::use_facet<codecvt<wchar_t, char, mbstate_t>>(__loc);
basic_string<wchar_t> __ws;
if (!__str_codecvt_in(__first, __last, __ws, __cvt))
@@ -450,6 +451,9 @@ path::_S_convert_loc(const char* __first, const char* __last,
#else
return _Cvt<wchar_t>::_S_convert(__ws.data(), __ws.data() + __ws.size());
#endif
+#else
+ return {__first, __last};
+#endif
}
std::size_t