diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-02-16 18:15:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-02-16 22:45:42 +0100 |
commit | c6db02a2afe4263e060fe6166db8e5426dd2ecd1 (patch) | |
tree | 6d4e6a9ab05176001d1a26ae433ab994f1df171f /solenv | |
parent | 2b58a0979f9206cfca6d78cb2f3d5e65cd735f8b (diff) |
Extend loplugin:stringview to OUStringBuffer::copy
(Somewhat oddly, there is no OStringBuffer::copy counterpart.)
This required some modification to StringView::VisitCXXConstructExpr to avoid
> In file included from odk/qa/checkapi/checkapi.cxx:29:
> In file included from workdir/CustomTarget/odk/allheaders/allheaders.hxx:351:
> In file included from instdir/sdk/include/rtl/math.hxx:31:
> instdir/sdk/include/rtl/ustrbuf.hxx:1687:16: error: rather than copy, pass with a view using subView() [loplugin:stringview]
> return copy( beginIndex, getLength() - beginIndex );
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
while building CppunitTest_odk_checkapi as external C++03 code, where the
returned value is wrapped in a CXXConstructExpr. And testing for that case
required a new CompilerTest_compilerplugins_clang-c++03 that uses gb_CXX03FLAGS
and needs to not set LIBO_INTERNAL_ONLY (via gb_CompilerTest_set_external_code),
as compiling as C++03 would otherwise generate lots of errors like unknown
char16_t at include/sal/types.h:118. (There was a choice whether to name the
new test "-c++03" or "-external", but the issue it tests is caused more by the
code being compiled with C++03 than by this being external code, see above.)
Change-Id: I873a9c5a70d3ea949cf13a169d46920b71282712
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130036
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/CompilerTest_compilerplugins_clang-c++03.mk | 20 | ||||
-rw-r--r-- | solenv/Module_solenv.mk | 1 | ||||
-rw-r--r-- | solenv/gbuild/CompilerTest.mk | 2 |
3 files changed, 23 insertions, 0 deletions
diff --git a/solenv/CompilerTest_compilerplugins_clang-c++03.mk b/solenv/CompilerTest_compilerplugins_clang-c++03.mk new file mode 100644 index 000000000000..8abe032203a0 --- /dev/null +++ b/solenv/CompilerTest_compilerplugins_clang-c++03.mk @@ -0,0 +1,20 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 100 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_CompilerTest_CompilerTest,compilerplugins_clang-c++03)) + +$(eval $(call gb_CompilerTest_add_exception_objects,compilerplugins_clang-c++03, \ + compilerplugins/clang/test/stringview-c++03 \ +)) + +$(eval $(call gb_CompilerTest_add_cxxflags,compilerplugins_clang-c++03,$(gb_CXX03FLAGS))) + +$(eval $(call gb_CompilerTest_set_external_code,compilerplugins_clang-c++03)) + +# vim: set noet sw=4 ts=4: diff --git a/solenv/Module_solenv.mk b/solenv/Module_solenv.mk index a26775f71083..6b9f7d0f1a8c 100644 --- a/solenv/Module_solenv.mk +++ b/solenv/Module_solenv.mk @@ -45,6 +45,7 @@ ifneq ($(COMPILER_PLUGINS),) ifeq ($(COMPILER_EXTERNAL_TOOL)$(COMPILER_PLUGIN_TOOL),) $(eval $(call gb_Module_add_check_targets,solenv, \ CompilerTest_compilerplugins_clang \ + CompilerTest_compilerplugins_clang-c++03 \ )) endif endif diff --git a/solenv/gbuild/CompilerTest.mk b/solenv/gbuild/CompilerTest.mk index ad6c55411f19..fb5150f2cdf0 100644 --- a/solenv/gbuild/CompilerTest.mk +++ b/solenv/gbuild/CompilerTest.mk @@ -45,6 +45,8 @@ gb_CompilerTest_add_objcxxobject = $(call gb_CompilerTest__forward_to_Linktarget gb_CompilerTest_add_objcxxobjects = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_CompilerTest_add_cxxclrobject = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_CompilerTest_add_cxxclrobjects = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) +gb_CompilerTest_add_cxxflags = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) +gb_CompilerTest_set_external_code = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_CompilerTest_use_externals = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) gb_CompilerTest_use_udk_api = $(call gb_CompilerTest__forward_to_Linktarget,$(0),$(1),$(2),$(3)) |