[libc++] Implement P0980R1 (constexpr std::string)
Reviewed By: #libc, ldionne Spies: daltenty, sdasgup3, ldionne, arichardson, MTC, ChuanqiXu, mehdi_amini, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes, tatianashp, rdzhabarov, teijeong, cota, dcaballe, Chia-hungDuan, wrengr, wenzhicui, arphaman, Mordante, miscco, Quuxplusone, smeenai, libcxx-commits Differential Revision: https://reviews.llvm.org/D110598
This commit is contained in:
1 parent
6e078f9804
commit
425620ccdd
211 files changed
+2291
-2074
No files matched your search
@@ -8,7 +8,7 @@
|
||||
|
||||
// <string>
|
||||
|
||||
// basic_string() noexcept(is_nothrow_default_constructible<allocator_type>::value);
|
||||
// basic_string() noexcept(is_nothrow_default_constructible<allocator_type>::value); // constexpr since C++20
|
||||
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
@@ -25,7 +25,7 @@ LIBCPP_STATIC_ASSERT(!std::is_nothrow_default_constructible<
|
||||
std::basic_string<char, std::char_traits<char>, limited_allocator<char, 10>>>::value, "");
|
||||
#endif
|
||||
|
||||
bool test() {
|
||||
TEST_CONSTEXPR_CXX20 bool test() {
|
||||
std::string str;
|
||||
assert(str.empty());
|
||||
|
||||
@@ -36,7 +36,7 @@ int main(int, char**)
|
||||
{
|
||||
test();
|
||||
#if TEST_STD_VER > 17
|
||||
// static_assert(test());
|
||||
static_assert(test());
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user