bin/find-unneeded-includes        |    9 +++++++++
 i18npool/IwyuFilter_i18npool.yaml |    2 --
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 85148426ab3340dbd7365122ab32fa3eb255ee88
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Wed Oct 15 09:55:12 2025 +0200
Commit:     Miklos Vajna <[email protected]>
CommitDate: Wed Oct 15 13:26:27 2025 +0200

    bin/find-unneeded-includes: skip versioned namespace
    
    This has led to
    commit 62a9df7473f4213d6ac63faa0a7c0555212bfdee
    "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 <[email protected]>

diff --git a/bin/find-unneeded-includes b/bin/find-unneeded-includes
index 423aa4eae64b..1f82f2b044b1 100755
--- a/bin/find-unneeded-includes
+++ b/bin/find-unneeded-includes
@@ -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.
diff --git a/i18npool/IwyuFilter_i18npool.yaml 
b/i18npool/IwyuFilter_i18npool.yaml
index a94ab69792ea..337c7cb60781 100644
--- a/i18npool/IwyuFilter_i18npool.yaml
+++ b/i18npool/IwyuFilter_i18npool.yaml
@@ -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

Reply via email to