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

github-actions bot commented Nov 12, 2025

Test Results

    10 files      10 suites   1d 17h 10m 2s ⏱️
 2 599 tests  2 599 ✅ 0 💤 0 ❌
24 367 runs  24 367 ✅ 0 💤 0 ❌

Results for commit ca96566.

♻️ This comment has been updated with latest results.

@hahnjo hahnjo merged commit 13aaade into root-project:v6-32-00-patches Nov 13, 2025
22 of 24 checks passed
@hahnjo hahnjo deleted the unique_ptr-zero-v632 branch November 13, 2025 07:33
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