Skip to content

[cling] Use SuppressUnwrittenScope to strip anonymous namespace names#22753

Open
devajithvs wants to merge 1 commit into
root-project:masterfrom
devajithvs:suppressunwrittenscope
Open

[cling] Use SuppressUnwrittenScope to strip anonymous namespace names#22753
devajithvs wants to merge 1 commit into
root-project:masterfrom
devajithvs:suppressunwrittenscope

Conversation

@devajithvs

@devajithvs devajithvs commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Since LLVM12, suppressing inline and anonymous namespaces were separated into distinct flags:

  • SuppressUnwrittenScope: suppresses anonymous namespaces
  • SuppressInlineNamespace: suppresses inline namespaces

See: llvm/llvm-project@5f12f4ff

We are relying on SuppressScope which is removed in LLVM22. SuppressUnwrittenScope can be used to strip anonymous namespace prefixes.

Without this flag types in anonymous namespaces will be printed as '::(anonymous namespace)::EvNavHandler' which is invalid C++ and causes compilation failures in rootcling-generated dictionary code as seen when building dd4hep against ROOT LLVM22.

This Pull request:

Changes or fixes:

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #

@devajithvs devajithvs requested a review from vgvassilev July 3, 2026 14:39
Since LLVM12, suppressing inline and anonymous namespaces were separated
into distinct flags:
- SuppressUnwrittenScope: suppresses anonymous namespaces
- SuppressInlineNamespace: suppresses inline namespaces

See: llvm/llvm-project@5f12f4ff

We are relying on `SuppressScope` which is removed in LLVM22.
`SuppressUnwrittenScope` can be used to strip anonymous namespace prefixes

Without this flag types in anonymous namespaces will be printed as
'::(anonymous namespace)::EvNavHandler' which is invalid C++ and causes
compilation failures in rootcling-generated dictionary code as seen when
building dd4hep against ROOT LLVM22.
@devajithvs devajithvs force-pushed the suppressunwrittenscope branch from 759a1b2 to 94f5069 Compare July 3, 2026 14:42

@vgvassilev vgvassilev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 13h 2m 2s ⏱️
 3 874 tests  3 852 ✅   0 💤 22 ❌
78 801 runs  78 676 ✅ 103 💤 22 ❌

For more details on these failures, see this check.

Results for commit 94f5069.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants