office-gobmx/external/poppler/char_traits.patch
Stephan Bergmann b789f54cb0 external/poppler: Fix use of std::char_trait<unsigned short>
...now that it is gone from libc++ 16 trunk since
<aeecef08c3>
"[libc++] Remove default definition of std::char_traits", causing

> In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx:20:
> In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.hxx:24:
> In file included from sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:36:
> In file included from workdir/UnpackedTarball/poppler/poppler/GfxState.h:41:
> In file included from workdir/UnpackedTarball/poppler/poppler/Object.h:43:
> In file included from workdir/UnpackedTarball/poppler/goo/GooString.h:46:
> ~/llvm/inst/bin/../include/c++/v1/string:676:46: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
>     static_assert(( is_same<_CharT, typename traits_type::char_type>::value),
>                                              ^
> workdir/UnpackedTarball/poppler/cpp/poppler-global.h:101:43: note: in instantiation of template class 'std::basic_string<unsigned short>' requested here
> class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
>                                           ^
> ~/llvm/inst/bin/../include/c++/v1/__fwd/string.h:22:29: note: template is declared here
> struct _LIBCPP_TEMPLATE_VIS char_traits;
>                             ^
> In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.cxx:20:
> In file included from sdext/source/pdfimport/xpdfwrapper/pnghelper.hxx:24:
> In file included from sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx:36:
> In file included from workdir/UnpackedTarball/poppler/poppler/GfxState.h:41:
> In file included from workdir/UnpackedTarball/poppler/poppler/Object.h:43:
> In file included from workdir/UnpackedTarball/poppler/goo/GooString.h:46:
> In file included from ~/llvm/inst/bin/../include/c++/v1/string:576:
> ~/llvm/inst/bin/../include/c++/v1/string_view:279:45: error: implicit instantiation of undefined template 'std::char_traits<unsigned short>'
>     static_assert((is_same<_CharT, typename traits_type::char_type>::value),
>                                             ^
> ~/llvm/inst/bin/../include/c++/v1/__type_traits/is_convertible.h:30:66: note: in instantiation of template class 'std::basic_string_view<unsigned short>' requested here
>     : public integral_constant<bool, __is_convertible_to(_T1, _T2)> {};
>                                                                  ^
> ~/llvm/inst/bin/../include/c++/v1/string:650:7: note: in instantiation of template class 'std::is_convertible<const std::basic_string<unsigned short> &, std::basic_string_view<unsigned short>>' requested here
>       is_convertible<const _Tp&, basic_string_view<_CharT, _Traits> >::value &&
>       ^
> ~/llvm/inst/bin/../include/c++/v1/string:967:35: note: in instantiation of template class 'std::__can_be_converted_to_string_view<unsigned short, std::char_traits<unsigned short>, std::basic_string<unsigned short>>' requested here
>             class = __enable_if_t<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value &&
>                                   ^
> ~/llvm/inst/bin/../include/c++/v1/string:969:93: note: in instantiation of default argument for 'basic_string<std::basic_string<unsigned short>>' required here
>   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(
>                                                                                             ^~~~~~~~~~~~~
> ~/llvm/inst/bin/../include/c++/v1/string:657:7: note: while substituting deduced template arguments into function template 'basic_string' [with _Tp = std::basic_string<unsigned short>, $1 = (no value)]
> class basic_string
>       ^
> workdir/UnpackedTarball/poppler/cpp/poppler-global.h:101:26: note: while declaring the implicit copy constructor for 'ustring'
> class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
>                          ^
> ~/llvm/inst/bin/../include/c++/v1/__fwd/string.h:22:29: note: template is declared here
> struct _LIBCPP_TEMPLATE_VIS char_traits;
>                             ^

Change-Id: Ia1dfda1866ffac22b1c8c99eb11412c095bcc4a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143237
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-11-24 23:14:01 +01:00

11 lines
387 B
Diff

--- cpp/poppler-global.h
+++ cpp/poppler-global.h
@@ -98,7 +98,7 @@
# pragma warning(push)
# pragma warning(disable : 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
#endif
-class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
+class POPPLER_CPP_EXPORT ustring : public std::u16string
{
public:
ustring();