codemaker/source/cppumaker/cpputype.cxx | 2 +- sd/source/ui/inc/futext.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
New commits: commit c08e5db055c9d34d3f0b0b9d2a192d7ebdcd9576 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Mon Dec 5 11:24:49 2022 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Mon Dec 5 21:59:45 2022 +0000 Make check for complete type more explicit When 485c9d4f0e59e13e772da8f8a7975f0ddd77c33e "Clarify the use of untools::WeakReference" introduced cppu::detail::isUnoInterfaceType and its use in the requires-clause of unotools::WeakReference::get, its commit message argued that while isUnoInterfaceType only works if the given type is complete, that would already be taken care of via the use of std::is_convertible_v in the implementation of unotools::WeakReference::get. But while std::is_convertible_v nominally requires its argument types to be complete (unless they are void, or arrays of unknown bound), typical implementations like recent libc++ or libstdc++ do not seem to enforce that (and just return false in such a case). So better make isUnoInterfaceType explicitly require that the given type is complete. Which turned up one case where it isn't at the point where unotools::WeakReference<SdrTextObj>::get is called. (And while the resulting call to dynamic_cast<SdrTextObj*>(...) in the implementation of that function would cause an error when SdrTextObj is not complete, compilers happened to instantiate that template specialization only at the end of the TU, by which time SdrTextObj happened to be a complete type in the TUs including that sd/source/ui/inc/futext.hxx. So all happened to work out OK.) Change-Id: I704b8b437fa836e290245d1727e4d356128ef63c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143667 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 2c8f938e6bb1..bb8e3ed7d33c 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -1198,7 +1198,7 @@ void InterfaceType::dumpHppFile( if (name_ == "com.sun.star.uno.XInterface") { out << "template<typename> struct IsUnoInterfaceType: ::std::false_type {};\n" "template<typename T> inline constexpr auto isUnoInterfaceType =" - " IsUnoInterfaceType<T>::value;\n"; + " sizeof (T) && IsUnoInterfaceType<T>::value;\n"; } out << "template<> struct IsUnoInterfaceType<"; dumpType(out, name_, false, false, true); diff --git a/sd/source/ui/inc/futext.hxx b/sd/source/ui/inc/futext.hxx index 310df1455af1..681597b4cd6d 100644 --- a/sd/source/ui/inc/futext.hxx +++ b/sd/source/ui/inc/futext.hxx @@ -20,9 +20,9 @@ #pragma once #include "fuconstr.hxx" +#include <svx/svdotext.hxx> #include <unotools/weakref.hxx> -class SdrTextObj; class FontList; class OutlinerView;