#include <memory>
#include <utility>
typedef std::unique_ptr<int> i_ptr;
typedef std::pair<i_ptr, i_ptr> i_pair;
i_ptr foo() { i_ptr p; return p; }
i_pair bar() { i_pair p; return p; }
i_pair bad() { i_ptr p, q; return std::make_pair(p, q); }
i_pair better() { i_ptr p, q; return std::make_pair(std::move(p), std::move(q)); }
int main() {
}
I2luY2x1ZGUgPG1lbW9yeT4KI2luY2x1ZGUgPHV0aWxpdHk+Cgp0eXBlZGVmIHN0ZDo6dW5pcXVlX3B0cjxpbnQ+IGlfcHRyOwp0eXBlZGVmIHN0ZDo6cGFpcjxpX3B0ciwgaV9wdHI+IGlfcGFpcjsKCmlfcHRyIGZvbygpIHsgaV9wdHIgcDsgcmV0dXJuIHA7IH0KCmlfcGFpciBiYXIoKSB7IGlfcGFpciBwOyByZXR1cm4gcDsgfQoKaV9wYWlyIGJhZCgpIHsgaV9wdHIgcCwgcTsgcmV0dXJuIHN0ZDo6bWFrZV9wYWlyKHAsIHEpOyB9CgppX3BhaXIgYmV0dGVyKCkgeyBpX3B0ciBwLCBxOyByZXR1cm4gc3RkOjptYWtlX3BhaXIoc3RkOjptb3ZlKHApLCBzdGQ6Om1vdmUocSkpOyB9CgppbnQgbWFpbigpIHsKfQ==
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/move.h:38:0,
from /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_pair.h:60,
from /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_algobase.h:66,
from /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/memory:63,
from prog.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/type_traits: In instantiation of 'const bool std::__is_convertible_helper<std::unique_ptr<int>&, std::unique_ptr<int>, false>::__value':
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/type_traits:312:5: instantiated from 'std::is_convertible<std::unique_ptr<int>&, std::unique_ptr<int> >'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_pair.h:253:49: instantiated from 'std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = std::unique_ptr<int>&, _T2 = std::unique_ptr<int>&, typename std::__decay_and_strip<_T2>::__type = std::unique_ptr<int>, typename std::__decay_and_strip<_Tp>::__type = std::unique_ptr<int>]'
prog.cpp:11:54: instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/unique_ptr.h:207:7: error: deleted function 'std::unique_ptr<_Tp, _Tp_Deleter>::unique_ptr(const std::unique_ptr<_Tp, _Tp_Deleter>&) [with _Tp = int, _Tp_Deleter = std::default_delete<int>, std::unique_ptr<_Tp, _Tp_Deleter> = std::unique_ptr<int>]'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/type_traits:302:71: error: used here
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/type_traits:302:71: error: initializing argument 1 of 'static std::__sfinae_types::__one std::__is_convertible_helper<_From, _To, false>::__test(_To) [with _From = std::unique_ptr<int>&, _To = std::unique_ptr<int>, std::__sfinae_types::__one = char]'
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_algobase.h:66:0,
from /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/memory:63,
from prog.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/unique_ptr.h: In constructor 'std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = std::unique_ptr<int>&, _U2 = std::unique_ptr<int>&, <template-parameter-2-3> = void, _T1 = std::unique_ptr<int>, _T2 = std::unique_ptr<int>]':
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_pair.h:253:49: instantiated from 'std::pair<typename std::__decay_and_strip<_Tp>::__type, typename std::__decay_and_strip<_T2>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = std::unique_ptr<int>&, _T2 = std::unique_ptr<int>&, typename std::__decay_and_strip<_T2>::__type = std::unique_ptr<int>, typename std::__decay_and_strip<_Tp>::__type = std::unique_ptr<int>]'
prog.cpp:11:54: instantiated from here
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/unique_ptr.h:207:7: error: deleted function 'std::unique_ptr<_Tp, _Tp_Deleter>::unique_ptr(const std::unique_ptr<_Tp, _Tp_Deleter>&) [with _Tp = int, _Tp_Deleter = std::default_delete<int>, std::unique_ptr<_Tp, _Tp_Deleter> = std::unique_ptr<int>]'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_pair.h:109:33: error: used here
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/unique_ptr.h:207:7: error: deleted function 'std::unique_ptr<_Tp, _Tp_Deleter>::unique_ptr(const std::unique_ptr<_Tp, _Tp_Deleter>&) [with _Tp = int, _Tp_Deleter = std::default_delete<int>, std::unique_ptr<_Tp, _Tp_Deleter> = std::unique_ptr<int>]'
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/bits/stl_pair.h:109:33: error: used here