Skip to content

Commit

Permalink
fix DefaultArgExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Dec 26, 2024
1 parent 7aaf997 commit 64e7715
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4262,6 +4262,8 @@ Expr* ReverseModeVisitor::getStdInitListSizeExpr(const Expr* E) {

// FIXME: Restore arguments passed as non-const reference.
for (const auto* arg : CE->arguments()) {
if (isa<CXXDefaultArgExpr>(arg->IgnoreImplicit()))
break;
QualType ArgTy = arg->getType();
StmtDiff argDiff{};
Expr* adjointArg = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions test/Gradient/STLCustomDerivatives.C
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ int main() {
// CHECK-NEXT: }

// CHECK: void fn22_grad(double u, double v, double *_d_u, double *_d_v) {
// CHECK-NEXT: std::vector<double> ls{u, v};
// CHECK-NEXT: std::vector<double> ls{{.*u, v.*}};
// CHECK-NEXT: std::vector<double> _d_ls(ls);
// CHECK-NEXT: clad::zero_init(_d_ls);
// CHECK-NEXT: std::vector<double> _t0 = ls;
Expand Down Expand Up @@ -910,7 +910,7 @@ int main() {
// CHECK-NEXT: break;
// CHECK-NEXT: }
// CHECK-NEXT: _t0++;
// CHECK-NEXT: clad::push(_t1, ls) , ls = {u, v};
// CHECK-NEXT: clad::push(_t1, ls) , ls = {{.*u, v.*}};
// CHECK-NEXT: _d_ls = ls;
// CHECK-NEXT: clad::zero_init(_d_ls);
// CHECK-NEXT: clad::push(_t2, ls);
Expand Down

0 comments on commit 64e7715

Please sign in to comment.