From: Marshall Clow Date: Thu, 22 Feb 2018 05:14:20 +0000 (+0000) Subject: Add another test case to the deduction guide for basic_string. X-Git-Tag: llvmorg-7.0.0-rc1~12300 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c83937370155ddf0a5fd117b817155a5cd978ff;p=platform%2Fupstream%2Fllvm.git Add another test case to the deduction guide for basic_string. llvm-svn: 325740 --- diff --git a/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp index b83275a..815b560 100644 --- a/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.cons/iter_alloc_deduction.pass.cpp @@ -41,6 +41,17 @@ int main() { { const char* s = "12345678901234"; + std::basic_string s1(s, s+10); // Can't use {} here + using S = decltype(s1); // what type did we get? + static_assert(std::is_same_v, ""); + static_assert(std::is_same_v>, ""); + static_assert(std::is_same_v>, ""); + assert(s1.size() == 10); + assert(s1.compare(0, s1.size(), s, s1.size()) == 0); + } + + { + const char* s = "12345678901234"; std::basic_string s1{s, s+10, std::allocator{}}; using S = decltype(s1); // what type did we get? static_assert(std::is_same_v, "");