diff --git a/include/locale b/include/locale index f999cd984..3d804e86f 100644 --- a/include/locale +++ b/include/locale @@ -3634,7 +3634,7 @@ wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>:: : __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)), __wide_err_string_(_VSTD::move(__wc.__wide_err_string_)), __cvtptr_(__wc.__cvtptr_), - __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtstate_) + __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtcount_) { __wc.__cvtptr_ = nullptr; } diff --git a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp new file mode 100644 index 000000000..d4cb88e0c --- /dev/null +++ b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp @@ -0,0 +1,33 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// wstring_convert + +// wstring_convert(wstring_convert&& other); // EXTENSION + +#include +#include +#include + +int main() +{ + typedef std::codecvt_utf8 Codecvt; + typedef std::wstring_convert Myconv; + // create a converter and perform some conversions to generate some + // interesting state. + Myconv myconv; + myconv.from_bytes("\xF1\x80\x80\x83"); + const int old_converted = myconv.converted(); + assert(myconv.converted() == 4); + // move construct a new converter and make sure the state is the same. + Myconv myconv2(std::move(myconv)); + assert(myconv2.converted() == 4); +} diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp new file mode 100644 index 000000000..53b9ed6a1 --- /dev/null +++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/ctor_copy.pass.cpp @@ -0,0 +1,27 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// wstring_convert + +// wstring_convert(wstring_convert const&) = delete; +// wstring_convert& operator=(wstring_convert const&) = delete; + +#include +#include +#include + +int main() +{ + typedef std::codecvt_utf8 Codecvt; + typedef std::wstring_convert Myconv; + static_assert(!std::is_copy_constructible::value, ""); + static_assert(!std::is_copy_assignable::value, ""); +}