LWG issues 2174/5/6 - mark wstring_convert::converted as noexcept, and make (some of) the constructors for wstring_convert and wbuffer_convert as explicit. Add configuration macro _LIBCPP_EXPLICIT_AFTER_CXX11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189398 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -37,6 +37,10 @@ void operator delete(void* p) throw()
|
||||
int main()
|
||||
{
|
||||
typedef std::wbuffer_convert<std::codecvt_utf8<wchar_t> > B;
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
static_assert(!std::is_convertible<std::streambuf*, B>::value, "");
|
||||
static_assert( std::is_constructible<B, std::streambuf*>::value, "");
|
||||
#endif
|
||||
{
|
||||
B b;
|
||||
assert(b.rdbuf() == nullptr);
|
||||
|
@@ -30,5 +30,9 @@ int main()
|
||||
typedef std::wstring_convert<Codecvt> Myconv;
|
||||
Myconv myconv(new Codecvt);
|
||||
assert(myconv.converted() == 0);
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
static_assert(!std::is_convertible<Codecvt*, Myconv>::value, "");
|
||||
static_assert( std::is_constructible<Myconv, Codecvt*>::value, "");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@@ -22,6 +22,10 @@ int main()
|
||||
{
|
||||
typedef std::codecvt_utf8<wchar_t> Codecvt;
|
||||
typedef std::wstring_convert<Codecvt> Myconv;
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
static_assert(!std::is_convertible<std::string, Myconv>::value, "");
|
||||
static_assert( std::is_constructible<Myconv, std::string>::value, "");
|
||||
#endif
|
||||
{
|
||||
Myconv myconv;
|
||||
try
|
||||
|
Reference in New Issue
Block a user