This reverts commit eb9e4e7a6c, see the note in
the original description of
<https://bugs.documentfoundation.org/show_bug.cgi?id=143148#c0> "Use pragma once
instead of include guards (Episode 2: Endgame)": "There are some source files
containing include guards that are meant to also be processed by compilers other
than LO's build baseline compilers: All URE include files [...] For those
source files, it is probably better to conservatively stick with include guards
than to replace them with #pragma once."
Change-Id: I315aa935db8617fadd2fb807b6fa7da05f44359d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162288
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Inspired by
<https://gcc.gnu.org/pipermail/gcc-patches/2022-November/607102.html> "[PATCH]
doc: -Wdelete-non-virtual-dtor supersedes -Wnon-virtual-dtor", drop explicitly
enabling -Wnon-virtual-dtor in favor of -Wdelete-non-virtual-dtor, which is
already enabled by -Wall.
(-Wdelete-non-virtual-dtor first appeared in Clang 3.0,
<https://github.com/llvm/llvm-project/commit/8bd428574c717e68a8274739d2ba0f6dc16fd0fb>
"Add new warning that warns when invoking 'delete' on a polymorphic, non-final,
class without a virtual destructor", and GCC 4.7,
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=014ab419efc12a59efebd2720d79e1c055675c85>
"invoke.texi: Document -Wdelete-non-virtual-dtor. [...]")
Dropping the explicit setting of -Wnon-virtual-dtor (and nowhere setting it
implicitly via -Weffc++) means we can get rid of lots of places that either set
-Wno-non-virtual-dtor or use some pragma to ignore -Wnon-virtual-dtor.
(In various places across extensions/source/activex/ and winaccessibility/, the
commits f26996bd33 "Silence
-Werror,-Wnon-virtual-dtor in generated so_activex.h (clang-cl)" and
c6086ca653 "Silence -Werror,-Wnon-virtual-dtor in
generated UAccCOM.h (clang-cl)" had singled out some includes to wrap them in
pragmas. Now that those pragmas are gone again, move those includes back to
where they had been prior to being singled out. And the -Wno-non-virtual-dtor
in external/firebird/macos-arm64.patch.0 appeared first in
ccd0e5f445 "Make firebird build for macOS on
arm64", which, though it doesn't state it explicitly, apparently created that
patch's builds/posix/prefix.darwin_arm64 as a copy of firebird's already
existing builds/posix/prefix.* files, which routinely include that warning
option too, so keep it there too even if it is probably irrelevant throughout.)
Change-Id: I7e4fa9f2c07e267b2ed15607905027f6b78142f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143182
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
> In file included from cppuhelper/source/access_control.cxx:21:
> include\cppuhelper/access_control.hxx(58,5): error: definition of implicit copy assignment operator for 'AccessControl' is deprecated because it has a user-provided copy constructor [-Werror,-Wdeprecated-copy-with-user-provided-copy]
> AccessControl( ::cppu::AccessControl const & ac );
> ^
> include\cppuhelper/access_control.hxx(37,44): note: in implicit copy assignment operator for 'cppu::AccessControl' first required here
> class SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC AccessControl
> ^
> include\cppuhelper/access_control.hxx(37,23): note: due to 'AccessControl' being dllexported
> class SAL_WARN_UNUSED CPPUHELPER_DLLPUBLIC AccessControl
> ^
> include\cppuhelper/cppuhelperdllapi.h(30,30): note: expanded from macro 'CPPUHELPER_DLLPUBLIC'
> #define CPPUHELPER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
> ^
> include\sal/types.h(208,47): note: expanded from macro 'SAL_DLLPUBLIC_EXPORT'
> # define SAL_DLLPUBLIC_EXPORT __declspec(dllexport)
Change-Id: I89b534b33c29fdc2d458087e1f3c2f4c958aa86c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140096
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
I messed up when I added
commit a0ebc6f898
Date: Sat Nov 9 08:47:48 2019 +0200
missing move operator=
which is not a real move operator because it has the wrong type in it's
parameter list, and doesn't actually do anything useful as a
consequence.
Change-Id: I7bd3d41d6ed98deecd143b1e1bb64870530dab03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129816
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
It missed some occurrences of 0 when only looking into uninstantiated template
code, as Clang doesn't model them with an ImplicitCastExpr, even if the target
is known to be a (dependent) pointer type.
Looking into all template instantiations of course carries the risk that a given
use of 0 is meant to be interpreted as a pointer in some and as an integer in
other instantiations. But the only case where that happened in the current code
base is RegistryValueList::getElement (include/registry/registry.hxx), where {}
is arguably a better choice anyway. (And which would presumably also hold for
any future such cases.)
Change-Id: I708bcfc8bedc0a49c9282d7814eb325afa29905c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128462
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
I assume this was originally added to work around some broken doc
generator, but we don't enforce comments for namespaces today, so this
is no longer needed.
Change-Id: Ia2311658516be84b26ae69e09362af560d793a7f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126963
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
- Replace all uses of OImplementationId in core with UnoIdInit
- Deprecate OImplementationId in <cppuhelper/typeprovider.hxx>
OImplementationId uses broken double checked locking; additionally,
it uses it at the first call to getImplementationId, not when the
object is constructed. This implementation can't be changed, cince
it's part of published API; it can't rely on C++11, which would be
required for use of thread-safe statics and move the initialization
to ctor.
The class has obsolete _bUseEthernetAddress member, that is unused
and ignored since 4e9fa7e339. No need
to implement it when replacing its uses to UnoIdInit.
The deprecation is the API CHANGE. No published API is introduced to
replace it; 3rd-party code should seek alternative solutions, or just
keep using the deprecated functionality.
TODO (in separate commits):
- Change implementations of getSomething to use getSomethingImpl
- Revise uses of getSomething to use getFromUnoTunnel
Change-Id: I8b6e684e5389bc0d5bb3b7f21f72a4c8f684107d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122077
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This file is only included from CppunitTest_odk_checkapi. As that is
compiled with $(gb_CXX03FLAGS), loplugin:noexcept hasn't caught these on Linux
or macOS (see the comment in Noexcept::run, compilerplugins/clang/noexcept.cxx).
And while the plugin could have caught them with clang-cl on Windows (cf.
95d109fd5f "Document that setting gb_CXX03FLAGS
for clang-cl doesn't work", all the instances are in macro definitions that are
never expanded by any LO code.
Change-Id: Ia3f3a0cd89df15bee517cd3a91a2a12a15a7a279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115794
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
instead of fighting the fact that Sequence is intended to be immutable
getSequence() will become a little slower, but since getSequence()
is called 5k times during 'make check', while add/remove are called
3M times, I think it's safe to say mutation is dominant.
Change-Id: I23d127c93c589050d6c06c0da47871e1ebe7b52d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86929
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
idea from mike kaganski
look for places where we can mark move operators as noexcept, which
makes some STL operations more efficient
Change-Id: Id732b89d1fcadd5ceb0ea2b9d159fed06136330f
Reviewed-on: https://gerrit.libreoffice.org/78251
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
include/osl/thread.h:198: warning: argument 'name' from the argument list of osl_setThreadName has muliple @param documentation sections
include/cppuhelper/propshlp.hxx:329: warning: argument 'bIgnoreRuntimeExceptionsWhileFiring' from the argument list of cppu::IEventNotificationHook::fireEvents has muliple @param documentation sections
Change-Id: Ic1a2a7239596ec62c0d60c14480ea4a115eaaaa1
Reviewed-on: https://gerrit.libreoffice.org/68944
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(added recently with d559c28e9e "expand out
IMPL_XTYPEPROVIDER_START macro"), for extra compatibility safety. (At least
MSVC exports non-inline versions of such CPPUHELPER_DLLPUBLIC inline functions
from the cppuhelper DLL.) The original getTypes (added back now with
<https://gerrit.libreoffice.org/#/c/68549/> "revert ABI change from 'expand out
IMPL_XTYPEPROVIDER_START macro'") had been a non-const member function ever
since at least b525a3115f "initial import",
presumably by accident. (Whether or not to return a reference is an orthogonal
issue. With the newly added overload being LIBO_INTERNAL_ONLY, it is presumably
fine to have it return a reference for now and see whether that causes any
issues with lifetimes of temporary OTypeCollection instances.)
Change-Id: If6abcf53b46b972204598774fed7cdd34d78440b
Reviewed-on: https://gerrit.libreoffice.org/68637
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.
Change-Id: Ib420e9216b8313f5ed7634ec375e39ceb741fd45
Reviewed-on: https://gerrit.libreoffice.org/59297
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
...by explicitly defaulting the copy/move functions (and, where needed in turn,
also a default ctor) for classes that have a user-declared dtor that does
nothing other than an implicitly-defined one would do, but needs to be user-
declared because it is virtual and potentially serves as a key function to
emit the vtable, or is non-public, etc. (For LIBO_INTERNAL_ONLY.)
Change-Id: I9da48559b083bdec9b1b4014634f6f3bfb1c3de3
Reviewed-on: https://gerrit.libreoffice.org/58107
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but may prevent implicitly declared copy
functions from being defined as non-deleted in the future
Change-Id: I2b7b6b8baa872addfb2adb0d551d78de1e31c896
Reviewed-on: https://gerrit.libreoffice.org/58106
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: I3966d302241a52014aaad41f72924a2095ea6621