forked from OSchip/llvm-project
[libc++] Remove noexcept specifier from operator""s
For some reason `operator""s(const char8_t*, size_t)` was marked `noexcept`. Remove it and add regression tests. Reviewed By: ldionne, huixie90, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D132340
This commit is contained in:
parent
74742147ee
commit
cac9a6fb0e
|
@ -4736,7 +4736,7 @@ inline namespace literals
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
#ifndef _LIBCPP_HAS_NO_CHAR8_T
|
||||||
inline _LIBCPP_HIDE_FROM_ABI constexpr
|
inline _LIBCPP_HIDE_FROM_ABI constexpr
|
||||||
basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len) _NOEXCEPT
|
basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len)
|
||||||
{
|
{
|
||||||
return basic_string<char8_t> (__str, __len);
|
return basic_string<char8_t> (__str, __len);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
//
|
||||||
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||||
|
// See https://llvm.org/LICENSE.txt for license information.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||||
|
//
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++03, c++11
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
|
|
||||||
|
static_assert(!noexcept(std::operator""s(std::declval<const char*>(), std::declval<int>())), "");
|
||||||
|
#ifndef TEST_HAS_NO_CHAR8_T
|
||||||
|
static_assert(!noexcept(std::operator""s(std::declval<const char8_t*>(), std::declval<int>())), "");
|
||||||
|
#endif
|
||||||
|
static_assert(!noexcept(std::operator""s(std::declval<const char16_t*>(), std::declval<int>())), "");
|
||||||
|
static_assert(!noexcept(std::operator""s(std::declval<const char32_t*>(), std::declval<int>())), "");
|
||||||
|
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
|
||||||
|
static_assert(!noexcept(std::operator""s(std::declval<const wchar_t*>(), std::declval<int>())), "");
|
||||||
|
#endif
|
Loading…
Reference in New Issue