summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-12-12 17:13:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-12-12 22:00:31 +0100
commite4fac1ebbdc73e72fb79ab5d6743e0cc49b558d1 (patch)
treeba3b9398026754ef72d4d00ee4bddea0221c629c /solenv
parentdac33e465a19f0cdd8b8450ca1631cb3e09d771f (diff)
Enable -Wdeprecated-copy-dtor where available
We already get -Wdeprecated-copy (warning about implicitly defined copy functions that will in the future be deleted because other user-provided copy functions exist) automatically through -Wextra, where available. -Wdeprecated-copy-dtor (warning about implicitly defined copy functions that will in the future be deleted because of a user-provided dtor) is split off into its own warning excluded from -Wextra for somewhat unclear reasons, see the discussion at <https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=88136> "-Wdeprecated-copy is draconian and shouldn't be in -Wall". But -Wdeprecated-copy-dtor has been useful in finding issues (esp. the Clang 10 trunk version, which, unlike the GCC 9 version, also finds copy functions that are implicitly defined because they are used from template instantiations), see 3e59716375a240576fd6d8759b32b4319506ed70 "Prevent BroadcastRecalcOnRefMoveHandler copies" and 4f98cd0f9ce9c2a331a5d34b3ef9d18f9bb6b235 "ScShapeChild has broken copy functions". We need to disable -Wdeprecated-copy-dtor in files included from external/boost, and in two compilerplugin/clang/test/ files. Change-Id: I74b159c3a046e23661473ddbfe53c92c4136a9db Reviewed-on: https://gerrit.libreoffice.org/85073 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 13c770baa79f..5cc24413bb45 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -85,6 +85,10 @@ gb_CXXFLAGS_COMMON := \
-fstack-protector-strong \
$(if $(gb_COLOR),-fdiagnostics-color=always) \
+ifeq ($(HAVE_WDEPRECATED_COPY_DTOR),TRUE)
+gb_CXXFLAGS_COMMON += -Wdeprecated-copy-dtor
+endif
+
gb_CXXFLAGS_DISABLE_WARNINGS = -w
ifeq ($(HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED),TRUE)