Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 6 years ago

Language

C++

Compiler

clang 8.0.0

Options
Warnings
Boost 1.70.0
C++17
no pedantic

Author

anonymous

about 6 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.70.0/clang-8.0.0/include -std=c++17
In file included from prog.cc:4:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/iostream:38:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/ios:216:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/__locale:15:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/string:505:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/string_view:176:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/__string:57:
In file included from /opt/wandbox/clang-8.0.0/include/c++/v1/algorithm:644:
/opt/wandbox/clang-8.0.0/include/c++/v1/memory:1826:31: error: no matching constructor for initialization of 'aggregate'
            ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
                              ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/wandbox/clang-8.0.0/include/c++/v1/memory:1718:18: note: in instantiation of function template specialization 'std::__1::allocator<aggregate>::construct<aggregate, int, double, char const (&)[4]>' requested here
            {__a.construct(__p, _VSTD::forward<_Args>(__args)...);}
                 ^
/opt/wandbox/clang-8.0.0/include/c++/v1/memory:1561:14: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<aggregate> >::__construct<aggregate, int, double, char const (&)[4]>' requested here
            {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
             ^
/opt/wandbox/clang-8.0.0/include/c++/v1/vector:1688:25: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<aggregate> >::construct<aggregate, int, double, char const (&)[4]>' requested here
        __alloc_traits::construct(this->__alloc(),
                        ^
prog.cc:16:7: note: in instantiation of function template specialization 'std::__1::vector<aggregate, std::__1::allocator<aggregate> >::emplace_back<int, double, char const (&)[4]>' requested here
  vec.emplace_back(10, 1.0, "abc");  //compile error!
      ^
prog.cc:7:8: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
struct aggregate {
       ^
prog.cc:7:8: note: candidate constructor (the implicit move constructor) not viable: requires 1 argument, but 3 were provided
prog.cc:7:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 3 were provided
1 error generated.
Exit Code:
1