Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support std::initializer_list parameters in the reverse mode #1212

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PetroZarytskyi
Copy link
Collaborator

Previously, we replaced std::initializer_list variables with clad::array in the reverse mode so that they become modifiable. This PR moves the logic for type replacement from RMV::DifferentiateVarDecl to aRMV::CloneType to use it to handle constructors with std::initializer_list parameters.

Fixes #1082.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

include/clad/Differentiator/STLBuiltins.h Outdated Show resolved Hide resolved
@PetroZarytskyi PetroZarytskyi force-pushed the issue-1082 branch 2 times, most recently from 3d62efd to 330e841 Compare January 7, 2025 19:38
Copy link
Contributor

github-actions bot commented Jan 7, 2025

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.57%. Comparing base (584eb31) to head (330e841).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1212   +/-   ##
=======================================
  Coverage   94.56%   94.57%           
=======================================
  Files          51       51           
  Lines        8829     8842   +13     
=======================================
+ Hits         8349     8362   +13     
  Misses        480      480           
Files with missing lines Coverage Δ
include/clad/Differentiator/ReverseModeVisitor.h 98.18% <ø> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.33% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

Files with missing lines Coverage Δ
include/clad/Differentiator/ReverseModeVisitor.h 98.18% <ø> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.33% <100.00%> (+0.02%) ⬆️

... and 1 file with indirect coverage changes

Previously, we replaced ``std::initializer_list`` variables with ``clad::array`` in the reverse mode so that they become modifiable. This PR moves the logic for type replacement from ``RMV::DifferentiateVarDecl`` to a``RMV::CloneType`` to use it to handle constructors with ``std::initializer_list`` parameters.

Fixes vgvassilev#1082.
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

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.

Clad crashes when trying to initialise a class type declaration in the reverse mode
1 participant