Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- In file included from test.cpp:2:
- In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/memory:82:
- In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:52:
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr_base.h:1106:50: error:
- cannot cast 'List' to its private base class 'const enable_shared_from_this<Shared>'
- __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:319:4: note:
- in instantiation of function template specialization 'std::__shared_ptr<List,
- __gnu_cxx::_Lock_policy::_S_atomic>::__shared_ptr<std::allocator<List>>' requested here
- : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:619:14: note:
- in instantiation of function template specialization
- 'std::shared_ptr<List>::shared_ptr<std::allocator<List>>' requested here
- return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:635:19: note:
- in instantiation of function template specialization 'std::allocate_shared<List,
- std::allocator<List>>' requested here
- return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
- ^
- test.cpp:27:19: note: in instantiation of function template specialization 'std::make_shared<List>'
- requested here
- auto c = std::make_shared<List>();
- ^
- test.cpp:20:14: note: constrained by private inheritance here
- class List : private Container, virtual public Widget{
- ^~~~~~~~~~~~~~~~~
- In file included from test.cpp:2:
- In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/memory:82:
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:583:27: error:
- cannot cast 'List' to its private base class 'Shared'
- { _M_weak_this._M_assign(__p, __n); }
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:601:8: note:
- in instantiation of function template specialization
- 'std::enable_shared_from_this<Shared>::_M_weak_assign<List>' requested here
- __pe->_M_weak_assign(const_cast<_Tp2*>(__px), __pn);
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr_base.h:1106:4: note:
- in instantiation of function template specialization
- 'std::__enable_shared_from_this_helper<Shared, List>' requested here
- __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:319:4: note:
- in instantiation of function template specialization 'std::__shared_ptr<List,
- __gnu_cxx::_Lock_policy::_S_atomic>::__shared_ptr<std::allocator<List>>' requested here
- : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:619:14: note:
- in instantiation of function template specialization
- 'std::shared_ptr<List>::shared_ptr<std::allocator<List>>' requested here
- return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
- ^
- /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:635:19: note:
- in instantiation of function template specialization 'std::allocate_shared<List,
- std::allocator<List>>' requested here
- return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
- ^
- test.cpp:27:19: note: in instantiation of function template specialization 'std::make_shared<List>'
- requested here
- auto c = std::make_shared<List>();
- ^
- test.cpp:20:14: note: constrained by private inheritance here
- class List : private Container, virtual public Widget{
- ^~~~~~~~~~~~~~~~~
- 2 errors generated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement