mirror of
https://github.com/LibreOffice/core.git
synced 2025-08-16 14:47:01 +00:00

...which was introduced in <https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=117782e0c2a81a4b8170f87f0fe7190ee22548e2> "c++: add -Wsfinae-incomplete" and causes warnings like > In file included from include/vcl/event.hxx:28, > from libreofficekit/source/gtk/lokdocview.cxx:26: > include/vcl/outdev.hxx:160:37: error: defining ‘OutputDevice’, which previously failed to be complete in a SFINAE context [-Werror=sfinae-incomplete=] > 160 | class SAL_WARN_UNUSED VCL_DLLPUBLIC OutputDevice : public virtual VclReferenceBase > | ^~~~~~~~~~~~ > In file included from include/vcl/vclevent.hxx:24, > from include/svtools/colorcfg.hxx:29, > from include/vcl/themecolors.hxx:12, > from include/vcl/settings.hxx:26, > from include/vcl/event.hxx:26: > include/vcl/vclptr.hxx:44:13: note: here. Use ‘-Wsfinae-incomplete=2’ for a diagnostic at that point > 44 | int (*)[sizeof(T)]) > | ^~~~~~~~~ because > include/vcl/vclptr.hxx:44:13: error: failed to complete ‘OutputDevice’ in SFINAE context [-Werror=sfinae-incomplete=] > 44 | int (*)[sizeof(T)]) > | ^~~~~~~~~ > include/vcl/vclptr.hxx: In substitution of ‘template<class T> constexpr bool vcl::detail::isIncompleteOrDerivedFromVclReferenceBase(int (*)[sizeof (T)]) [with T = VirtualDevice]’: > include/vcl/vclptr.hxx:60:79: required from ‘class VclPtr<VirtualDevice>’ > 60 | vcl::detail::isIncompleteOrDerivedFromVclReferenceBase<reference_type>( > | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ > 61 | nullptr), > | ~~~~~~~~ > include/vcl/outdev.hxx:188:37: required from here > 188 | VclPtr<VirtualDevice> mpAlphaVDev; > | ^~~~~~~~~~~ As discussed in the newly added comment in include/vcl/vclptr.hxx, until we can address this with C++26 reflection, "use a HACK of (globally) ignoring that warning". (Which required adding a new HAVE_GCC_WSFINAE_INCOMPLETE configure check.) Change-Id: Ie1b44e730cf6b6269572158f6bd50e8911c15846 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188115 Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com> Tested-by: Jenkins