Author
anonymous
almost 8 years ago
Language
Compiler
Options
Author
anonymous
almost 8 years ago
$ prog.cc:10:12: error: no viable conversion from returned value of type 'unique_ptr<Derived, default_delete<Derived>>' to function return type 'unique_ptr<Base, default_delete<Base>>'
return derived;
^~~~~~~
/opt/wandbox/clang-3.8.1/include/c++/v1/memory:2557:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'std::__1::unique_ptr<Derived, std::__1::default_delete<Derived> >' to 'const std::__1::unique_ptr<Base, std::__1::default_delete<Base> > &' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY unique_ptr
^
/opt/wandbox/clang-3.8.1/include/c++/v1/memory:2586:49: note: candidate constructor not viable: no known conversion from 'std::__1::unique_ptr<Derived, std::__1::default_delete<Derived> >' to 'nullptr_t' for 1st argument
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
^
/opt/wandbox/clang-3.8.1/include/c++/v1/memory:2613:31: note: candidate constructor not viable: no known conversion from 'std::__1::unique_ptr<Derived, std::__1::default_delete<Derived> >' to 'std::__1::unique_ptr<Base, std::__1::default_delete<Base> > &&' for 1st argument
_LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
^
/opt/wandbox/clang-3.8.1/include/c++/v1/memory:2617:9: note: candidate constructor [with _Up = Derived, _Ep = std::__1::default_delete<Derived>] not viable: no known conversion from 'std::__1::unique_ptr<Derived, std::__1::default_delete<Derived> >' to 'unique_ptr<Derived, std::__1::default_delete<Derived> > &&' for 1st argument
unique_ptr(unique_ptr<_Up, _Ep>&& __u,
^
/opt/wandbox/clang-3.8.1/include/c++/v1/memory:2632:35: note: candidate template ignored: could not match 'auto_ptr' against 'unique_ptr'
_LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p,
^
1 error generated.
Exit Code:
1