[Libreoffice-commits] core.git: external/pdfium

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 18 09:06:46 UTC 2020


 external/pdfium/UnpackedTarball_pdfium.mk |    1 +
 external/pdfium/c++20-comparison.patch    |   13 +++++++++++++
 2 files changed, 14 insertions(+)

New commits:
commit 6e0461d576d9f386e458f98f3c57f0ba385aacb4
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Jan 17 18:27:14 2020 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Jan 18 10:06:16 2020 +0100

    external/pdfium: C++20 comparison operator fix
    
    Missing const leads to overload resolution ambiguity when a synthesized
    candidate of operator == for a reversed-argument rewrite conflicts with the
    actual operator ==, due to the asymmetric const-ness of the implicit object
    parameter and the RHS parameter:
    
    > In file included from workdir/UnpackedTarball/pdfium/core/fxge/cfx_font.cpp:7:
    > In file included from workdir/UnpackedTarball/pdfium/core/fxge/cfx_font.h:11:
    > llvm/inst/include/c++/v1/vector:1369:27: error: use of overloaded operator '!=' is ambiguous (with operand types 'std::__1::__vector_base<unsigned char, FxAllocAllocator<unsigned char> >::allocator_type' (aka 'FxAllocAllocator<unsigned char>') and 'std::__1::__vector_base<unsigned char, FxAllocAllocator<unsigned char> >::allocator_type')
    >     if (__base::__alloc() != __c.__alloc())
    >         ~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~
    > llvm/inst/include/c++/v1/vector:1359:5: note: in instantiation of member function 'std::__1::vector<unsigned char, FxAllocAllocator<unsigned char> >::__move_assign' requested here
    >     __move_assign(__x, integral_constant<bool,
    >     ^
    > workdir/UnpackedTarball/pdfium/core/fxge/cfx_font.cpp:384:24: note: in instantiation of member function 'std::__1::vector<unsigned char, FxAllocAllocator<unsigned char> >::operator=' requested here
    >   m_FontDataAllocation = std::vector<uint8_t, FxAllocAllocator<uint8_t>>(
    >                        ^
    > workdir/UnpackedTarball/pdfium/core/fxcrt/fx_memory_wrappers.h:74:8: note: candidate function
    >   bool operator!=(const FxAllocAllocator& that) { return false; }
    >        ^
    > workdir/UnpackedTarball/pdfium/core/fxcrt/fx_memory_wrappers.h:73:8: note: candidate function
    >   bool operator==(const FxAllocAllocator& that) { return true; }
    >        ^
    > workdir/UnpackedTarball/pdfium/core/fxcrt/fx_memory_wrappers.h:73:8: note: candidate function (with reversed parameter order)
    
    Change-Id: I48cfc8ce37287d9d3c0dec8c4d8b14b53de895d9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86993
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index 2874bd72719f..ba1a7e994dbf 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -14,6 +14,7 @@ pdfium_patches += ubsan.patch
 pdfium_patches += build.patch.1
 # Avoids Windows 8 build dependency.
 pdfium_patches += windows7.patch.1
+pdfium_patches += c++20-comparison.patch
 
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
diff --git a/external/pdfium/c++20-comparison.patch b/external/pdfium/c++20-comparison.patch
new file mode 100644
index 000000000000..025f9ba010db
--- /dev/null
+++ b/external/pdfium/c++20-comparison.patch
@@ -0,0 +1,13 @@
+--- core/fxcrt/fx_memory_wrappers.h
++++ core/fxcrt/fx_memory_wrappers.h
+@@ -70,8 +70,8 @@
+   }
+ 
+   // There's no state, so they are all the same,
+-  bool operator==(const FxAllocAllocator& that) { return true; }
+-  bool operator!=(const FxAllocAllocator& that) { return false; }
++  bool operator==(const FxAllocAllocator& that) const { return true; }
++  bool operator!=(const FxAllocAllocator& that) const { return false; }
+ };
+ 
+ #endif  // CORE_FXCRT_FX_MEMORY_WRAPPERS_H_


More information about the Libreoffice-commits mailing list