diff --git a/lib/Differentiator/BaseForwardModeVisitor.cpp b/lib/Differentiator/BaseForwardModeVisitor.cpp index 41b174f5c..3e4c000df 100644 --- a/lib/Differentiator/BaseForwardModeVisitor.cpp +++ b/lib/Differentiator/BaseForwardModeVisitor.cpp @@ -1392,7 +1392,7 @@ StmtDiff BaseForwardModeVisitor::VisitUnaryOperator(const UnaryOperator* UnOp) { Expr* derivedOp = BuildOp(UO_Minus, diff.getExpr_dx()); return {op, derivedOp}; } else { - unsupportedOpWarn(UnOp->getEndLoc()); + unsupportedOpWarn(UnOp->getOperatorLoc()); auto zero = ConstantFolder::synthesizeLiteral(m_Context.IntTy, m_Context, 0); return StmtDiff(op, zero); @@ -1534,7 +1534,7 @@ BaseForwardModeVisitor::VisitBinaryOperator(const BinaryOperator* BinOp) { opDiff = BuildOp(opCode, Ldiff.getExpr_dx(), Rdiff.getExpr()); } else { // FIXME: add support for other binary operators - unsupportedOpWarn(BinOp->getEndLoc()); + unsupportedOpWarn(BinOp->getOperatorLoc()); opDiff = ConstantFolder::synthesizeLiteral(m_Context.IntTy, m_Context, 0); } if (opDiff) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 1080788be..032ebb0a4 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -2333,7 +2333,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, // discontinuity in the function space. // FIXME: We should support boolean differentiation or ignore it // completely - unsupportedOpWarn(UnOp->getEndLoc()); + unsupportedOpWarn(UnOp->getOperatorLoc()); diff = Visit(E); ResultRef = diff.getExpr_dx(); } @@ -2657,7 +2657,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, // FIXME: We should support boolean differentiation or ignore it // completely if (!BinOp->isComparisonOp() && !BinOp->isLogicalOp()) - unsupportedOpWarn(BinOp->getEndLoc()); + unsupportedOpWarn(BinOp->getOperatorLoc()); return BuildOp(opCode, Visit(L).getExpr(), Visit(R).getExpr()); } diff --git a/test/FirstDerivative/FunctionCallsWithResults.C b/test/FirstDerivative/FunctionCallsWithResults.C index 91d7d95bd..8eae9e94c 100644 --- a/test/FirstDerivative/FunctionCallsWithResults.C +++ b/test/FirstDerivative/FunctionCallsWithResults.C @@ -1,6 +1,7 @@ // RUN: %cladclang %s -I%S/../../include -oFunctionCallsWithResults.out \ // RUN: -Xclang -verify 2>&1 | %filecheck %s // RUN: ./FunctionCallsWithResults.out | %filecheck_exec %s +//CHECK-NOT: {{.*error|warning|note:.*}} #include "clad/Differentiator/Differentiator.h" #include