bin/find-unneeded-includes: skip versioned namespace

This has led to
commit 62a9df7473
"find-unneded-includes: avoid replacing includes with forward-declarations"

now the replacement of unicode/regex.h with a versioned namespace is not suggested

Change-Id: Ic30954561739591bd483382ed75a56f5901ac993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192428
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
This commit is contained in:
Gabor Kelemen
2025-10-15 13:26:27 +02:00
committed by Miklos Vajna
parent 1e89ae7b07
commit 85148426ab
2 changed files with 9 additions and 2 deletions
+9
View File
@@ -134,6 +134,15 @@ def ignoreRemoval(include, toAdd, absFileName, moduleRules, noexclude):
if include == "box2d/box2d.h" and "box2d/b2_world.h" in toAdd:
return True
# Skip forward declaration of versioned namespaces
# see https://gerrit.libreoffice.org/c/core/+/72972
# for an example of breakage caused by this
if include == "unicode/regex.h":
for item in toAdd:
match = re.search(r'namespace icu.* class RegexMatcher', item)
if match:
return True
noRemove = (
# <https://www.openoffice.org/tools/CodingGuidelines.sxw> insists on not
# removing this.
-2
View File
@@ -82,8 +82,6 @@ excludelist:
# Base class needs complete type
- com/sun/star/util/XTextSearch2.hpp
- com/sun/star/lang/XServiceInfo.hpp
# contains versioned namespace so cannot forward declare
- unicode/regex.h
i18npool/source/collator/collator_unicode.cxx:
# Config options are used in #ifdef
- config_locales.h