[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
@@ -6,9 +6,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
// <string>
|
||||
|
||||
// explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator());
|
||||
// explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator()); // constexpr since C++20
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
@@ -75,7 +77,7 @@ test(std::basic_string_view<charT> sv, const A& a)
|
||||
}
|
||||
}
|
||||
|
||||
bool test() {
|
||||
TEST_CONSTEXPR_CXX20 bool test() {
|
||||
{
|
||||
typedef test_allocator<char> A;
|
||||
typedef std::basic_string_view<char, std::char_traits<char> > SV;
|
||||
@@ -118,7 +120,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