Unverified Commit ed3936e9 authored by Niklas Korz's avatar Niklas Korz Committed by GitHub
Browse files

xalanc: fix Clang 19 and GCC 15 compat (#407880)

parents b7407d86 37140015
Loading
Loading
Loading
Loading
+48 −0
Original line number Diff line number Diff line
diff --git a/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp b/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
index 8741cea49..075b1ad4f 100644
--- a/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
+++ b/src/xalanc/XMLSupport/XalanOtherEncodingWriter.hpp
@@ -301,43 +301,6 @@ public:
         return write(chars, start, length, m_charRefFunctor);
     }
 
-    void
-    writeSafe(
-            const XalanDOMChar*     theChars,
-            size_type               theLength)
-    {
-        for(size_type i = 0; i < theLength; ++i)
-        {
-            const XalanDOMChar  ch = theChars[i];
-
-            if (isUTF16HighSurrogate(ch) == true)
-            {
-                if (i + 1 >= theLength)
-                {
-                    throwInvalidUTF16SurrogateException(ch, 0,  getMemoryManager());
-                }
-                else 
-                {
-                    XalanUnicodeChar    value = decodeUTF16SurrogatePair(ch, theChars[i+1],  getMemoryManager());
-
-                    if (this->m_isPresentable(value))
-                    {
-                        write(value);
-                    }
-                    else
-                    {
-                        this->writeNumberedEntityReference(value);
-                    }
-
-                    ++i;
-                }
-            }
-            else
-            {
-                write(static_cast<XalanUnicodeChar>(ch));
-            }
-        }
-    }
 
     void
     write(const XalanDOMChar*     theChars)
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,16 @@ stdenv.mkDerivation {
    sha256 = "sha256:0q1204qk97i9h14vxxq7phcfpyiin0i1zzk74ixvg4wqy87b62s8";
  };

  patches = [
    # See https://github.com/llvm/llvm-project/issues/96859
    # xalan-c contains a templated code path that tries to access non-existent methods,
    # but before Clang 19 and GCC 15 this was no error as the template was never instantiated.
    # Note that the suggested fix of adding "-fdelayed-template-parsing"
    # to CXX_FLAGS would be sufficient for Clang 19, but as it would break again
    # once we upgrade to GCC 15, we remove the dead code entirely.
    ./0001-clang19-gcc15-compat.patch
  ];

  nativeBuildInputs = [ cmake ];
  buildInputs = [
    xercesc