Advertisement
igagis

clang++ error

Feb 23rd, 2017
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. In file included from test.cpp:2:
  2. In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/memory:82:
  3. 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:
  4. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr_base.h:1106:50: error:
  5. cannot cast 'List' to its private base class 'const enable_shared_from_this<Shared>'
  6. __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
  7. ^
  8. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:319:4: note:
  9. in instantiation of function template specialization 'std::__shared_ptr<List,
  10. __gnu_cxx::_Lock_policy::_S_atomic>::__shared_ptr<std::allocator<List>>' requested here
  11. : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
  12. ^
  13. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:619:14: note:
  14. in instantiation of function template specialization
  15. 'std::shared_ptr<List>::shared_ptr<std::allocator<List>>' requested here
  16. return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
  17. ^
  18. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:635:19: note:
  19. in instantiation of function template specialization 'std::allocate_shared<List,
  20. std::allocator<List>>' requested here
  21. return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
  22. ^
  23. test.cpp:27:19: note: in instantiation of function template specialization 'std::make_shared<List>'
  24. requested here
  25. auto c = std::make_shared<List>();
  26. ^
  27. test.cpp:20:14: note: constrained by private inheritance here
  28. class List : private Container, virtual public Widget{
  29. ^~~~~~~~~~~~~~~~~
  30. In file included from test.cpp:2:
  31. In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/memory:82:
  32. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:583:27: error:
  33. cannot cast 'List' to its private base class 'Shared'
  34. { _M_weak_this._M_assign(__p, __n); }
  35. ^
  36. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:601:8: note:
  37. in instantiation of function template specialization
  38. 'std::enable_shared_from_this<Shared>::_M_weak_assign<List>' requested here
  39. __pe->_M_weak_assign(const_cast<_Tp2*>(__px), __pn);
  40. ^
  41. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr_base.h:1106:4: note:
  42. in instantiation of function template specialization
  43. 'std::__enable_shared_from_this_helper<Shared, List>' requested here
  44. __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
  45. ^
  46. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:319:4: note:
  47. in instantiation of function template specialization 'std::__shared_ptr<List,
  48. __gnu_cxx::_Lock_policy::_S_atomic>::__shared_ptr<std::allocator<List>>' requested here
  49. : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
  50. ^
  51. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:619:14: note:
  52. in instantiation of function template specialization
  53. 'std::shared_ptr<List>::shared_ptr<std::allocator<List>>' requested here
  54. return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
  55. ^
  56. /usr/bin/../lib/gcc/x86_64-linux-gnu/6.3.0/../../../../include/c++/6.3.0/bits/shared_ptr.h:635:19: note:
  57. in instantiation of function template specialization 'std::allocate_shared<List,
  58. std::allocator<List>>' requested here
  59. return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
  60. ^
  61. test.cpp:27:19: note: in instantiation of function template specialization 'std::make_shared<List>'
  62. requested here
  63. auto c = std::make_shared<List>();
  64. ^
  65. test.cpp:20:14: note: constrained by private inheritance here
  66. class List : private Container, virtual public Widget{
  67. ^~~~~~~~~~~~~~~~~
  68. 2 errors generated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement