[RF] Make RooAbsDataHelper::Exec well-formed for an empty parameter pack#22805
Merged
Merged
Conversation
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.
Test Results 23 files 23 suites 3d 15h 16m 38s ⏱️ For more details on these failures, see this check. Results for commit 59cb661. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The body of RooAbsDataHelper::Exec used a range-based for loop over a braced-init-list of the parameter pack:
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.