Skip to content

[RF] Make RooAbsDataHelper::Exec well-formed for an empty parameter pack#22805

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:roo_abs_data_helper
Jul 14, 2026
Merged

[RF] Make RooAbsDataHelper::Exec well-formed for an empty parameter pack#22805
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:roo_abs_data_helper

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

The body of RooAbsDataHelper::Exec used a range-based for loop over a braced-init-list of the parameter pack:

for (auto &&val : {static_cast<double>(values)...})

With an empty pack this becomes for (auto &&val : {}), which is ill-formed since the element type cannot be deduced from an empty list.

The empty-pack instantiation is required to be well-formed by RDataFrame: instantiating Book<RInferredType, Helper> (as done when booking the helper from Python without explicit column types) compiles the no-columns branch of Book, which instantiates
RAction<Helper, ..., TypeList<>> and with it Exec<>.

This went unnoticed so far because cling's TClingCallFunc happens to skip the vtable-driven instantiation of the ill-formed virtual RAction::Run in the never-taken branch. The stricter wrapper compilation in CppInterOp surfaces the error, which made rf408_RDataFrameToRooFit.py fail with cppyy on top of CppInterOp.

Use a fold expression instead, which is valid for an empty pack.

🤖 Done with the help of AI.

The body of RooAbsDataHelper::Exec used a range-based for loop over a
braced-init-list of the parameter pack:

    for (auto &&val : {static_cast<double>(values)...})

With an empty pack this becomes `for (auto &&val : {})`, which is
ill-formed since the element type cannot be deduced from an empty list.

The empty-pack instantiation is required to be well-formed by
RDataFrame: instantiating Book<RInferredType, Helper> (as done when
booking the helper from Python without explicit column types) compiles
the no-columns branch of Book, which instantiates
RAction<Helper, ..., TypeList<>> and with it Exec<>.

This went unnoticed so far because cling's TClingCallFunc happens to
skip the vtable-driven instantiation of the ill-formed virtual
RAction::Run in the never-taken branch. The stricter wrapper
compilation in CppInterOp surfaces the error, which made
rf408_RDataFrameToRooFit.py fail with cppyy on top of CppInterOp.

Use a fold expression instead, which is valid for an empty pack.

🤖 Done with the help of AI.

@aaronj0 aaronj0 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@github-actions

Copy link
Copy Markdown

Test Results

    23 files      23 suites   3d 15h 16m 38s ⏱️
 3 870 tests  3 863 ✅   0 💤 7 ❌
78 747 runs  78 632 ✅ 108 💤 7 ❌

For more details on these failures, see this check.

Results for commit 59cb661.

@guitargeek guitargeek merged commit f68b322 into root-project:master Jul 14, 2026
40 of 42 checks passed
@guitargeek guitargeek deleted the roo_abs_data_helper branch July 14, 2026 09:27
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