Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 4 years ago

Language

C++

Compiler

clang 11.1.0

Options
Warnings
Don't Use Boost
C++11
no pedantic

Author

anonymous

over 4 years ago

$ clang++ prog.cc -Wall -Wextra -std=c++11
prog.cc:6:26: error: no matching constructor for initialization of 'std::shared_ptr<int>'
    std::shared_ptr<int> ptr(std::move(arr));
                         ^   ~~~~~~~~~~~~~~
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3560:23: note: candidate constructor not viable: no known conversion from 'typename remove_reference<unique_ptr<int [], default_delete<int []>> &>::type' (aka 'std::__1::unique_ptr<int [], std::__1::default_delete<int []>>') to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument
    _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
                      ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3574:5: note: candidate constructor not viable: no known conversion from 'typename remove_reference<unique_ptr<int [], default_delete<int []>> &>::type' (aka 'std::__1::unique_ptr<int [], std::__1::default_delete<int []>>') to 'const std::__1::shared_ptr<int>' for 1st argument
    shared_ptr(const shared_ptr& __r) _NOEXCEPT;
    ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3582:5: note: candidate constructor not viable: no known conversion from 'typename remove_reference<unique_ptr<int [], default_delete<int []>> &>::type' (aka 'std::__1::unique_ptr<int [], std::__1::default_delete<int []>>') to 'std::__1::shared_ptr<int>' for 1st argument
    shared_ptr(shared_ptr&& __r) _NOEXCEPT;
    ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3562:18: note: candidate template ignored: could not match '_Yp *' against 'typename remove_reference<unique_ptr<int [], default_delete<int []>> &>::type' (aka 'std::__1::unique_ptr<int [], std::__1::default_delete<int []>>')
        explicit shared_ptr(_Yp* __p,
                 ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3577:9: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
        shared_ptr(const shared_ptr<_Yp>& __r,
        ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3583:52: note: candidate template ignored: could not match 'shared_ptr' against 'unique_ptr'
    template<class _Yp> _LIBCPP_INLINE_VISIBILITY  shared_ptr(shared_ptr<_Yp>&& __r,
                                                   ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3587:34: note: candidate template ignored: could not match 'weak_ptr' against 'unique_ptr'
    template<class _Yp> explicit shared_ptr(const weak_ptr<_Yp>& __r,
                                 ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3592:9: note: candidate template ignored: could not match 'auto_ptr' against 'unique_ptr'
        shared_ptr(auto_ptr<_Yp>&& __r,
        ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3601:9: note: candidate template ignored: requirement '!is_array<int []>::value' was not satisfied [with _Yp = int [], _Dp = std::__1::default_delete<int []>]
        shared_ptr(unique_ptr<_Yp, _Dp>&&,
        ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3610:9: note: candidate template ignored: requirement 'is_lvalue_reference<std::__1::default_delete<int []>>::value' was not satisfied [with _Yp = int [], _Dp = std::__1::default_delete<int []>]
        shared_ptr(unique_ptr<_Yp, _Dp>&&,
        ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3558:23: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
                      ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3570:26: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    template <class _Dp> shared_ptr(nullptr_t __p, _Dp __d);
                         ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3572:51: note: candidate constructor template not viable: requires 2 arguments, but 1 was provided
    template<class _Yp> _LIBCPP_INLINE_VISIBILITY shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) _NOEXCEPT;
                                                  ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3565:9: note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided
        shared_ptr(_Yp* __p, _Dp __d,
        ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3571:40: note: candidate constructor template not viable: requires 3 arguments, but 1 was provided
    template <class _Dp, class _Alloc> shared_ptr(nullptr_t __p, _Dp __d, _Alloc __a);
                                       ^
/opt/wandbox/clang-11.1.0/include/c++/v1/memory:3568:9: note: candidate constructor template not viable: requires at least 3 arguments, but 1 was provided
        shared_ptr(_Yp* __p, _Dp __d, _Alloc __a,
        ^
1 error generated.
Exit Code:
1