diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-10-15 10:33:07 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-10-15 13:20:21 +0200 |
commit | af908d9f18fbb83a5c393f856026cebefd821f18 (patch) | |
tree | 8febcffa229c560089fe6e443d97575893531056 /slideshow/source/engine/opengl | |
parent | 99adfcad3517de6530c9a2f025c528001f543ae2 (diff) |
Avoid usage of incomplete types in member functions defined in-class
...that started to fail now at least with clang-cl (where the MSVC rules when to
emit inline member function definitions are more aggressive than for other ABIs)
with --with-latest-c++ and --with-visual-studio=2022 (where usage of incomplete
types in std::vector now triggered
> In file included from C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:31:
> In file included from C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\memory:11:
> In file included from C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\exception:12:
> C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(744,50): error: incomplete type 'Primitive' used in type trait expression
> struct is_trivially_destructible : bool_constant<__is_trivially_destructible(_Ty)> {
> ^
> C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(59,53): note: in instantiation of template class 'std::is_trivially_destructible<Primitive>' requested here
> struct conjunction<_First, _Rest...> : _Conjunction<_First::value, _First, _Rest...>::type {
> ^
> C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\type_traits(64,44): note: in instantiation of template class 'std::conjunction<std::is_trivially_destructible<Primitive>, std::disjunction<std::_Is_default_allocator<std::allocator<Primitive>>, std::_Has_no_alloc_destroy<std::allocator<Primitive>, Primitive *>>>' requested here
> _INLINE_VAR constexpr bool conjunction_v = conjunction<_Traits...>::value;
> ^
> C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\xmemory(934,20): note: in instantiation of variable template specialization 'std::conjunction_v<std::is_trivially_destructible<Primitive>, std::disjunction<std::_Is_default_allocator<std::allocator<Primitive>>, std::_Has_no_alloc_destroy<std::allocator<Primitive>, Primitive *>>>' requested here
> if constexpr (!conjunction_v<is_trivially_destructible<_Ty>, _Uses_default_destroy<_Alloc, _Ty*>>) {
> ^
> C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(1632,13): note: in instantiation of function template specialization 'std::_Destroy_range<std::allocator<Primitive>>' requested here
> _Destroy_range(_Myfirst, _Mylast, _Al);
> ^
> C:/PROGRA~1/MIB055~1/2022/Preview/VC/Tools/MSVC/1430~1.305/Include\vector(583,9): note: in instantiation of member function 'std::vector<Primitive>::_Tidy' requested here
> _Tidy();
> ^
> C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(74,5): note: in instantiation of member function 'std::vector<Primitive>::~vector' requested here
> TransitionScene(
> ^
> C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(42,7): note: forward declaration of 'Primitive'
> class Primitive;
> ^
etc.).
Which in turn required tweaking of loplugin:unnecessaryoverride to avoid false
> In file included from C:/lo-clang/core/slideshow/source/engine/opengl/TransitionerImpl.cxx:67:
> C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(389,18): error: unnecessary user-declared destructor [loplugin:unnecessaryoverride]
> TransitionScene::~TransitionScene() = default;
> ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
> C:/lo-clang/core/slideshow/source/engine/opengl/TransitionImpl.hxx(81,12): note: declared here [loplugin:unnecessaryoverride]
> inline ~TransitionScene();
> ~~~~~~~^~~~~~~~~~~~~~~~~~
Change-Id: Ia72fb44e6e92ff47376d7b7159c0df7cbf883b69
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123648
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'slideshow/source/engine/opengl')
-rw-r--r-- | slideshow/source/engine/opengl/TransitionImpl.hxx | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/slideshow/source/engine/opengl/TransitionImpl.hxx b/slideshow/source/engine/opengl/TransitionImpl.hxx index 9a869203cb56..9ca35c1e8f6d 100644 --- a/slideshow/source/engine/opengl/TransitionImpl.hxx +++ b/slideshow/source/engine/opengl/TransitionImpl.hxx @@ -71,18 +71,14 @@ typedef std::vector<std::shared_ptr<Operation> > Operations_t; class TransitionScene { public: - TransitionScene( + inline TransitionScene( Primitives_t&& rLeavingSlidePrimitives, Primitives_t&& rEnteringSlidePrimitives, Operations_t&& rOverallOperations = Operations_t(), SceneObjects_t&& rSceneObjects = SceneObjects_t() - ) - : maLeavingSlidePrimitives(std::move(rLeavingSlidePrimitives)) - , maEnteringSlidePrimitives(std::move(rEnteringSlidePrimitives)) - , maOverallOperations(std::move(rOverallOperations)) - , maSceneObjects(std::move(rSceneObjects)) - { - } + ); + + inline ~TransitionScene(); TransitionScene(TransitionScene const& rOther); TransitionScene& operator=(const TransitionScene& rOther); @@ -377,6 +373,21 @@ private: std::vector<Vertex> Vertices; }; +TransitionScene::TransitionScene( + Primitives_t&& rLeavingSlidePrimitives, + Primitives_t&& rEnteringSlidePrimitives, + Operations_t&& rOverallOperations, + SceneObjects_t&& rSceneObjects +) + : maLeavingSlidePrimitives(std::move(rLeavingSlidePrimitives)) + , maEnteringSlidePrimitives(std::move(rEnteringSlidePrimitives)) + , maOverallOperations(std::move(rOverallOperations)) + , maSceneObjects(std::move(rSceneObjects)) +{ +} + +TransitionScene::~TransitionScene() = default; + #endif // INCLUDED_SLIDESHOW_TRANSITION_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |