[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,10 +6,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
// <string>
|
||||
|
||||
// basic_string<charT,traits,Allocator>&
|
||||
// append(const basic_string<charT,traits>& str);
|
||||
// append(const basic_string<charT,traits>& str); // constexpr since C++20
|
||||
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -26,7 +28,7 @@ test(S s, S str, S expected)
|
||||
assert(s == expected);
|
||||
}
|
||||
|
||||
bool test() {
|
||||
TEST_CONSTEXPR_CXX20 bool test() {
|
||||
{
|
||||
typedef std::string S;
|
||||
test(S(), S(), S());
|
||||
@@ -92,7 +94,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