Skip to content

Conversation

@hahnjo
Copy link
Member

@hahnjo hahnjo commented Nov 12, 2025

Since llvm/llvm-project@f5e687d libc++ implements _LIBCPP_COMPRESSED_PAIR with an anonymous struct (a Clang extension). This results in unique_ptr having a single FieldDecl with an empty name that does not appear as a data member in TClass. Instead, the AST has multiple IndirectFieldDecls that "refer" into the anonymous struct.

In ROOT, we now have two options: We could support anonymous structs, either by allowing data members with empty names or by adding all indirect field declarations as members. However, I would argue that we actually do NOT want to support this extension for IO classes. Instead remove the (questionable) check in rootcling that verifies the number of data members in unique_ptr.

Related to #20377, backport of #20389

Since llvm/llvm-project@f5e687d
libc++ implements _LIBCPP_COMPRESSED_PAIR with an anonymous struct (a
Clang extension). This results in unique_ptr having a single FieldDecl
with an empty name that does not appear as a data member in TClass.
Instead, the AST has multiple IndirectFieldDecl's that "refer" into
the anonymous struct.

In ROOT, we now have two options: We could support anonymous structs,
either by allowing data members with empty names or by adding all
indirect field declarations as members. However, I would argue that
we actually do NOT want to support this extension for IO classes.
Instead remove the (questionable) check in rootcling that verifies
the number of data members in unique_ptr.

(cherry picked from commit fff03d2)
Since the previous commit, IsUnsupportedUniquePointer does not check
the number of data members anymore.

(cherry picked from commit a62a650)
@github-actions
Copy link

Test Results

    22 files      22 suites   3d 22h 29m 41s ⏱️
 3 709 tests  3 709 ✅ 0 💤 0 ❌
79 611 runs  79 611 ✅ 0 💤 0 ❌

Results for commit 4b9d991.

@hahnjo hahnjo merged commit b518eec into root-project:v6-38-00-patches Nov 12, 2025
31 checks passed
@hahnjo hahnjo deleted the unique_ptr-zero-v638 branch November 12, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants