File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,29 @@ boost::core::string_view f( boost::core::string_view const& str )
29
29
return str;
30
30
}
31
31
32
+ template <typename Char>
33
+ boost::core::basic_string_view<Char> f ( boost::core::basic_string_view<Char> const & str )
34
+ {
35
+ return str;
36
+ }
37
+
38
+ template <typename Char>
39
+ void subtest ()
40
+ {
41
+ std::basic_string<Char> s1 ( 3 , Char (' 1' ) );
42
+ s1[1 ] = Char (' 2' );
43
+ s1[2 ] = Char (' 3' );
44
+
45
+ std::basic_string<Char> s2 = f<Char>( s1 );
46
+ BOOST_TEST ( s1 == s2 );
47
+
48
+ #if ! (defined(BOOST_CLANG) && BOOST_CLANG_VERSION < 150000)
49
+ // leads to undefined symbols in Clang < 15: https://github.com/llvm/llvm-project/issues/55560
50
+ std::basic_string<Char> s3 ( (f<Char>( s1 )) );
51
+ BOOST_TEST ( s1 == s3 );
52
+ #endif
53
+ }
54
+
32
55
int main ()
33
56
{
34
57
{
@@ -62,5 +85,15 @@ int main()
62
85
63
86
#endif
64
87
88
+ #if !defined(BOOST_NO_CXX11_CHAR16_T)
89
+ subtest<char16_t >();
90
+ #endif
91
+ #if !defined(BOOST_NO_CXX11_CHAR32_T)
92
+ subtest<char32_t >();
93
+ #endif
94
+ #if defined(__cpp_char8_t) && __cpp_char8_t >= 201811L
95
+ subtest<char8_t >();
96
+ #endif
97
+
65
98
return boost::report_errors ();
66
99
}
You can’t perform that action at this time.
0 commit comments