[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
+5
-3
@@ -6,9 +6,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>& append(const charT* s);
|
||||
// basic_string<charT,traits,Allocator>& append(const charT* s); // constexpr since C++20
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
@@ -26,7 +28,7 @@ test(S s, const typename S::value_type* str, S expected)
|
||||
assert(s == expected);
|
||||
}
|
||||
|
||||
bool test() {
|
||||
TEST_CONSTEXPR_CXX20 bool test() {
|
||||
{
|
||||
typedef std::string S;
|
||||
test(S(), "", S());
|
||||
@@ -83,7 +85,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