Files
core/config_host
Stephan Bergmann dc01bb6306 Silence new GCC 16 trunk -Wsfinae-incomplete for now
...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
2025-07-21 18:11:10 +02:00
..

C/C++ Configuration Created by configure Script

These are configuration files for various features as detected by configure.

Include only those files you need (in order to reduce rebuilds when a setting changes).

Settings here are only C/C++ #define directives, so they apply only to C/C++ source, not to Makefiles.

Adding a New Setting:

  • do AC_DEFINE(HAVE_FOO) in configure.ac when a setting should be set
  • choose the proper config_host/config_XXX.h file to use
    • if it is a global setting (such as availability of a compiler feature), use config_host/config_global.h
    • otherwise check if there is a matching config_host/config_XXX.h file
    • if none matches, add a new one:
      • add config_host/config_XXX.h.in here, with just #ifndef include guard
      • add AC_CONFIG_HEADERS([config_host/config_XXX.h]) next to the others in configure.ac
  • add #define HAVE_FOO 0 to the config_host/config_XXX.h, possibly with a comment (do not use #undef HAVE_FOO, unless the setting has more values than on/off)
  • add #include <config_XXX.h> before any #if HAVE_FOO in a source file
  • make sure you use #if HAVE_FOO for on/off settings, do not use #ifdef