Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 5 years ago

Language

C++

Compiler

gcc HEAD 11.0.0 20200816 (experimental)

Options
Don't Use Boost
C++17
no pedantic

Author

anonymous

almost 5 years ago

$ g++ prog.cc -std=c++17
prog.cc: In function 'int main()':
prog.cc:5:59: error: class template argument deduction failed:
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
prog.cc:5:59: error: no matching function for call to 'unique_ptr(unsigned char*)'
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:468:7: note: candidate: 'template<class _Tp, class _Dp> unique_ptr(const std::unique_ptr<_Tp, _Dp>&)-> std::unique_ptr<_Tp, _Dp>'
  468 |       unique_ptr(const unique_ptr&) = delete;
      |       ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:468:7: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   mismatched types 'const std::unique_ptr<_Tp, _Dp>' and 'unsigned char*'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:87,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/backward/auto_ptr.h:328:5: note: candidate: 'template<class _Tp, class _Dp, class _Up, class> unique_ptr(std::auto_ptr<_Up>&&)-> std::unique_ptr<_Tp, _Dp>'
  328 |     unique_ptr<_Tp, _Dp>::unique_ptr(auto_ptr<_Up>&& __u) noexcept
      |     ^~~~~~~~~~~~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/backward/auto_ptr.h:328:5: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   mismatched types 'std::auto_ptr<_Up>' and 'unsigned char*'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:340:9: note: candidate: 'template<class _Tp, class _Dp, class _Up, class _Ep, class> unique_ptr(std::unique_ptr<_Up, _Ep>&&)-> std::unique_ptr<_Tp, _Dp>'
  340 |         unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
      |         ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:340:9: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   mismatched types 'std::unique_ptr<_Up, _Ep>' and 'unsigned char*'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:327:7: note: candidate: 'template<class _Tp, class _Dp> unique_ptr(std::unique_ptr<_Tp, _Dp>&&)-> std::unique_ptr<_Tp, _Dp>'
  327 |       unique_ptr(unique_ptr&&) = default;
      |       ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:327:7: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   mismatched types 'std::unique_ptr<_Tp, _Dp>' and 'unsigned char*'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:320:19: note: candidate: 'template<class _Tp, class _Dp, class _Del, class> unique_ptr(std::nullptr_t)-> std::unique_ptr<_Tp, _Dp>'
  320 |         constexpr unique_ptr(nullptr_t) noexcept
      |                   ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:320:19: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   couldn't deduce template parameter '_Tp'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:314:9: note: candidate: 'template<class _Tp, class _Dp, class _Del, class _DelUnref> unique_ptr(typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer, std::__enable_if_t<std::is_lvalue_reference<_Del>::value, _DelUnref&&>)-> std::unique_ptr<_Tp, _Dp>'
  314 |         unique_ptr(pointer,
      |         ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:314:9: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   candidate expects 2 arguments, 1 provided
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:306:9: note: candidate: 'template<class _Tp, class _Dp, class _Del, class> unique_ptr(typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer, std::__enable_if_t<(! std::is_lvalue_reference<_Del>::value), _Del&&>)-> std::unique_ptr<_Tp, _Dp>'
  306 |         unique_ptr(pointer __p,
      |         ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:306:9: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   candidate expects 2 arguments, 1 provided
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:294:9: note: candidate: 'template<class _Tp, class _Dp, class _Del, class> unique_ptr(typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer, const _Dp&)-> std::unique_ptr<_Tp, _Dp>'
  294 |         unique_ptr(pointer __p, const deleter_type& __d) noexcept
      |         ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:294:9: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   candidate expects 2 arguments, 1 provided
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:281:9: note: candidate: 'template<class _Tp, class _Dp, class _Del, class> unique_ptr(typename std::__uniq_ptr_impl<_Tp, _Dp>::pointer)-> std::unique_ptr<_Tp, _Dp>'
  281 |         unique_ptr(pointer __p) noexcept
      |         ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:281:9: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   couldn't deduce template parameter '_Tp'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:269:19: note: candidate: 'template<class _Tp, class _Dp, class _Del, class> unique_ptr()-> std::unique_ptr<_Tp, _Dp>'
  269 |         constexpr unique_ptr() noexcept
      |                   ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:269:19: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   candidate expects 0 arguments, 1 provided
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.0/memory:83,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:242:11: note: candidate: 'template<class _Tp, class _Dp> unique_ptr(std::unique_ptr<_Tp, _Dp>)-> std::unique_ptr<_Tp, _Dp>'
  242 |     class unique_ptr
      |           ^~~~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.0/bits/unique_ptr.h:242:11: note:   template argument deduction/substitution failed:
prog.cc:5:59: note:   mismatched types 'std::unique_ptr<_Tp, _Dp>' and 'unsigned char*'
    5 |     std::unique_ptr p(static_cast<unsigned char*>(nullptr));
      |                                                           ^
Exit Code:
1