[PATCH] D26830: [libcxx] Add string_view literals
EricWF added a comment. @AntonBikineev Yeah, this should be abandoned. Sorry my mistake. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added inline comments. Comment at: test/std/strings/string.view/string.view.literals/literal2.pass.cpp:16 + +int main() +{ EricWF wrote: > What's the point of this test that `literal.pass.cpp` doesn't cover? Ping on this comment. Comment at: test/std/strings/string.view/string.view.literals/literal3.pass.cpp:16 + +int main() +{ EricWF wrote: > You can move this test into `literal.pass.cpp` but putting it at another > function scope. Ping on this comment. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev added a comment. In https://reviews.llvm.org/D26830#711870, @EricWF wrote: > @AntonBikineev when will you be able to make he requested changes? I would > like to land this ASAP. Eric, have you looked at commit 7d32d2f5a1f39d4cae9469645faa74b647698001? This functionality has already been implemented by Marshall, we should abandon this patch. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev added a comment. In https://reviews.llvm.org/D26830#711870, @EricWF wrote: > @AntonBikineev when will you be able to make he requested changes? I would > like to land this ASAP. Will do that today https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added a comment. @AntonBikineev when will you be able to make he requested changes? I would like to land this ASAP. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added a comment. This LGTM. I'll approve once I see the inline comments addressed. Comment at: test/std/strings/string.view/string.view.literals/literal.pass.cpp:10 +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 This needs a `// XFAIL: clang-3, gcc-4, apple-clang-7, apple-clang-8` https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added inline comments. Comment at: test/std/strings/string.view/string.view.literals/literal3.pass.cpp:16 + +int main() +{ You can move this test into `literal.pass.cpp` but putting it at another function scope. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added a comment. Alright. I committed the Clang changes. Just re-building now so I can test this. Comment at: include/string_view:780 +} // namespace literals +#endif + `// _LIBCPP_STD_VER > 14` comment please. Comment at: test/std/strings/string.view/string.view.literals/literal1.pass.cpp:16 + +int main() +{ What's the point of this test that `literal.pass.cpp` doesn't cover? Comment at: test/std/strings/string.view/string.view.literals/literal2.pass.cpp:16 + +int main() +{ What's the point of this test that `literal.pass.cpp` doesn't cover? https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev added a comment. In https://reviews.llvm.org/D26830#619340, @EricWF wrote: > Please ping this once the Clang changes have been accepted. I'm just waiting > on those to give this the final OK. I don't have commit privileges to Clang either, so that patch is stuck. Could you commit there please? https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added a comment. Please ping this once the Clang changes have been accepted. I'm just waiting on those to give this the final OK. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev updated this revision to Diff 78532. AntonBikineev marked an inline comment as done. AntonBikineev added a comment. Fixing typos... https://reviews.llvm.org/D26830 Files: include/string_view test/std/strings/string.view/string.view.literals/literal.pass.cpp test/std/strings/string.view/string.view.literals/literal1.fail.cpp test/std/strings/string.view/string.view.literals/literal1.pass.cpp test/std/strings/string.view/string.view.literals/literal2.fail.cpp test/std/strings/string.view/string.view.literals/literal2.pass.cpp test/std/strings/string.view/string.view.literals/literal3.pass.cpp Index: test/std/strings/string.view/string.view.literals/literal3.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal3.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std; + +string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals::string_view_literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.fail.cpp @@ -0,0 +1,19 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +std::string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal1.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal1.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.fail.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using std::string_view; + +string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal.pass.cpp @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===--===// +// +//
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev marked an inline comment as done. AntonBikineev added inline comments. Comment at: include/string_view:749 +inline namespace literals +{ EricWF wrote: > AntonBikineev wrote: > > EricWF wrote: > > > If this is new to C++17 then the new declarations should be guarded by > > > `#if _LIBCPP_VERSION > 14`. > > Eric, I was thinking about it, but the fact that the whole string_view code > > is not guarded by _LIBCPP_VERSION > 14 (I guess it's because it can be > > compiled with lower Standards just fine) stopped me from doing that. I'm > > still not sure though. > Understandable. The decision to backport most of `string_view` was > intentional. > > However we shouldn't backport these, since the literal suffix is only > supported by the compiler in C++17. Agreed https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev updated this revision to Diff 78498. https://reviews.llvm.org/D26830 Files: include/string_view test/std/strings/string.view/string.view.literals/literal.pass.cpp test/std/strings/string.view/string.view.literals/literal1.fail.cpp test/std/strings/string.view/string.view.literals/literal1.pass.cpp test/std/strings/string.view/string.view.literals/literal2.fail.cpp test/std/strings/string.view/string.view.literals/literal2.pass.cpp test/std/strings/string.view/string.view.literals/literal3.pass.cpp Index: test/std/strings/string.view/string.view.literals/literal3.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal3.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std; + +string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals::string_view_literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.fail.cpp @@ -0,0 +1,19 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +std::string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal1.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal1.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.fail.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using std::string_view; + +string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal.pass.cpp @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev updated this revision to Diff 78497. https://reviews.llvm.org/D26830 Files: include/string_view test/std/strings/string.view/string.view.literals/literal.pass.cpp test/std/strings/string.view/string.view.literals/literal1.fail.cpp test/std/strings/string.view/string.view.literals/literal1.pass.cpp test/std/strings/string.view/string.view.literals/literal2.fail.cpp test/std/strings/string.view/string.view.literals/literal2.pass.cpp test/std/strings/string.view/string.view.literals/literal3.pass.cpp Index: test/std/strings/string.view/string.view.literals/literal3.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal3.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std; + +string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals::string_view_literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.fail.cpp @@ -0,0 +1,19 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +std::string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal1.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal1.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.fail.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using std::string_view; + +string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal.pass.cpp @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added inline comments. Comment at: include/string_view:749 +inline namespace literals +{ AntonBikineev wrote: > EricWF wrote: > > If this is new to C++17 then the new declarations should be guarded by `#if > > _LIBCPP_VERSION > 14`. > Eric, I was thinking about it, but the fact that the whole string_view code > is not guarded by _LIBCPP_VERSION > 14 (I guess it's because it can be > compiled with lower Standards just fine) stopped me from doing that. I'm > still not sure though. Understandable. The decision to backport most of `string_view` was intentional. However we shouldn't backport these, since the literal suffix is only supported by the compiler in C++17. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev updated this revision to Diff 78493. AntonBikineev marked an inline comment as done. https://reviews.llvm.org/D26830 Files: include/string_view test/std/strings/string.view/string.view.literals/literal.pass.cpp test/std/strings/string.view/string.view.literals/literal1.fail.cpp test/std/strings/string.view/string.view.literals/literal1.pass.cpp test/std/strings/string.view/string.view.literals/literal2.fail.cpp test/std/strings/string.view/string.view.literals/literal2.pass.cpp test/std/strings/string.view/string.view.literals/literal3.pass.cpp Index: test/std/strings/string.view/string.view.literals/literal3.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal3.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std; + +string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals::string_view_literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.fail.cpp @@ -0,0 +1,19 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +std::string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal1.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal1.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.fail.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using std::string_view; + +string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal.pass.cpp @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +//
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev added inline comments. Comment at: include/string_view:749 +inline namespace literals +{ EricWF wrote: > If this is new to C++17 then the new declarations should be guarded by `#if > _LIBCPP_VERSION > 14`. Eric, I was thinking about it, but the fact that the whole string_view code is not guarded by _LIBCPP_VERSION > 14 (I guess it's because it can be compiled with lower Standards just fine) stopped me from doing that. I'm still not sure though. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
EricWF added a comment. Which paper is this implementing? Also please update the synopsis comment at the top of the header. Comment at: include/string_view:749 +inline namespace literals +{ If this is new to C++17 then the new declarations should be guarded by `#if _LIBCPP_VERSION > 14`. Comment at: include/string_view:754 +_LIBCPP_CONSTEXPR +string_view operator "" sv(const char* __str, size_t __len) _NOEXCEPT +{ Please add `inline _LIBCPP_INLINE_VISIBILITY` to each of these declarations. https://reviews.llvm.org/D26830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D26830: [libcxx] Add string_view literals
AntonBikineev created this revision. AntonBikineev added reviewers: mclow.lists, rsmith, cfe-commits. Herald added a reviewer: EricWF. https://reviews.llvm.org/D26830 Files: include/string_view test/std/strings/string.view/string.view.literals/literal.pass.cpp test/std/strings/string.view/string.view.literals/literal1.fail.cpp test/std/strings/string.view/string.view.literals/literal1.pass.cpp test/std/strings/string.view/string.view.literals/literal2.fail.cpp test/std/strings/string.view/string.view.literals/literal2.pass.cpp test/std/strings/string.view/string.view.literals/literal3.pass.cpp Index: test/std/strings/string.view/string.view.literals/literal3.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal3.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std; + +string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals::string_view_literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal2.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal2.fail.cpp @@ -0,0 +1,19 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +std::string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal1.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.pass.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using namespace std::literals; + +std::string_view foo = ""sv; +} Index: test/std/strings/string.view/string.view.literals/literal1.fail.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal1.fail.cpp @@ -0,0 +1,21 @@ +// -*- C++ -*- +//===--===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===--===// + +// UNSUPPORTED: c++98, c++03, c++11, c++14 + +#include +#include + +int main() +{ +using std::string_view; + +string_view foo = ""sv; // should fail w/conversion operator not found +} Index: test/std/strings/string.view/string.view.literals/literal.pass.cpp === --- /dev/null +++ test/std/strings/string.view/string.view.literals/literal.pass.cpp @@ -0,0 +1,45 @@ +// -*- C++ -*- +//===--===// +// +//