Fix --with-latest-c++ build

> In file included from workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:8,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestCase.h:6,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:5,
>                  from workdir/UnpackedTarball/cppunit/include/cppunit/extensions/HelperMacros.h:9,
>                  from sal/qa/rtl/oustring/rtl_ustr.cxx:25:
> workdir/UnpackedTarball/cppunit/include/cppunit/tools/StringHelper.h: In instantiation of ‘typename std::enable_if<(! std::is_enum<_Tp>::value), std::__cxx11::basic_string<char> >::type CppUnit::StringHelper::toString(const T&) [with T = char16_t; typename std::enable_if<(! std::is_enum<_Tp>::value), std::__cxx11::basic_string<char> >::type = std::__cxx11::basic_string<char>]’:
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:74:50:   required from ‘static std::string CppUnit::assertion_traits<T>::toString(const T&) [with T = char16_t; std::string = std::__cxx11::basic_string<char>]’
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:168:58:   required from ‘void CppUnit::assertEquals(const T&, const T&, SourceLine, const std::string&) [with T = char16_t; std::string = std::__cxx11::basic_string<char>]’
> sal/qa/rtl/oustring/rtl_ustr.cxx:696:17:   required from here
> workdir/UnpackedTarball/cppunit/include/cppunit/tools/StringHelper.h:25:9: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char16_t) [with _Traits = char_traits<char>]’
>    25 |     ost << x;
>       |     ~~~~^~~~
> In file included from include/rtl/ustring.hxx:34,
>                  from sal/qa/rtl/oustring/rtl_ustr.cxx:22:
> ~/gcc/trunk/inst/include/c++/12.0.1/ostream:558:5: note: declared here
>   558 |     operator<<(basic_ostream<char, _Traits>&, char16_t) = delete;
>       |     ^~~~~~~~

Change-Id: I70ae970c10650d0e6efa5ced3a354090642d5387
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131164
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2022-03-08 08:04:38 +01:00
parent 82c879d8ff
commit 5f5d7931d9

View file

@ -19,6 +19,7 @@
#include <sal/config.h>
#include <o3tl/cppunittraitshelper.hxx>
#include <rtl/ustring.hxx>
#include <cppunit/TestFixture.h>