Author
anonymous
over 5 years ago
Language
C++
Compiler
clang 8.0.0
Options
Warnings
Boost 1.71.0
C++17
-pedantic-errors
Author
anonymous
over 5 years ago
$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.71.0/clang-8.0.0/include -std=c++17 -pedantic-errors
prog.cc:17:14: error: no matching constructor for initialization of 'std::any'
std::any a(std::move(m));
^ ~~~~~~~~~~~~
/opt/wandbox/clang-8.0.0/include/c++/v1/any:191:3: note: candidate constructor not viable: no known conversion from 'typename remove_reference<move_only &>::type' (aka 'move_only') to 'const std::__1::any' for 1st argument
any(any const & __other) : __h(nullptr)
^
/opt/wandbox/clang-8.0.0/include/c++/v1/any:197:3: note: candidate constructor not viable: no known conversion from 'typename remove_reference<move_only &>::type' (aka 'move_only') to 'std::__1::any' for 1st argument
any(any && __other) _NOEXCEPT : __h(nullptr)
^
/opt/wandbox/clang-8.0.0/include/c++/v1/any:503:6: note: candidate template ignored: requirement 'is_copy_constructible<move_only>::value' was not satisfied [with _ValueType = move_only, _Tp = move_only]
any::any(_ValueType && __v) : __h(nullptr)
^
/opt/wandbox/clang-8.0.0/include/c++/v1/any:509:6: note: candidate template ignored: could not match 'in_place_type_t<type-parameter-0-0>' against 'move_only'
any::any(in_place_type_t<_ValueType>, _Args&&... __args) {
^
/opt/wandbox/clang-8.0.0/include/c++/v1/any:514:6: note: candidate constructor template not viable: requires at least 2 arguments, but 1 was provided
any::any(in_place_type_t<_ValueType>, initializer_list<_Up> __il, _Args&&... __args) {
^
/opt/wandbox/clang-8.0.0/include/c++/v1/any:188:13: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
constexpr any() _NOEXCEPT : __h(nullptr) {}
^
1 error generated.
Exit Code:
1