xref: /aosp_15_r20/external/libcxx/test/std/strings/basic.string/string.cons/string_view.fail.cpp (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <string>
11 
12 // explicit basic_string(basic_string_view<CharT, traits> sv, const Allocator& a = Allocator());
13 
14 #include <string>
15 #include <string_view>
16 
foo(const string & s)17 void foo ( const string &s ) {}
18 
main()19 int main()
20 {
21     std::string_view sv = "ABCDE";
22     foo(sv);    // requires implicit conversion from string_view to string
23 }
24