Debian Codegraph @

libstdc++-v3/testsuite/ext/rope/101542.cc

raw
1 // { dg-do run { target c++11 } }
2 // PR libstdc++/101542
3 #include <ext/rope>
4 #include <testsuite_hooks.h>
5
6 template<typename T> T f(T x) { return x; }
7 template<typename T> T g(T x) { return std::move(x); }
8
9 int main()
10 {
11 std::string s;
12 {
13 __gnu_cxx::sequence_buffer<std::string> a(s);
14 {
15 __gnu_cxx::sequence_buffer<std::string> b = std::move(a);
16 b.push_back('h');
17 b.push_back('e');
18 b.push_back('l');
19 b.push_back('l');
20 b.push_back('o');
21
22 __gnu_cxx::sequence_buffer<std::string> c;
23 c = f(g((std::move(b))));
24 }
25 }
26 VERIFY( s == "hello" );
27 }