diff --git a/include/clad/Differentiator/ReverseModeVisitor.h b/include/clad/Differentiator/ReverseModeVisitor.h index 15c2528d7..7d058dda6 100644 --- a/include/clad/Differentiator/ReverseModeVisitor.h +++ b/include/clad/Differentiator/ReverseModeVisitor.h @@ -138,7 +138,7 @@ namespace clad { Stmts& getCurrentBlock(direction d = direction::forward) { if (d == direction::forward) return m_Blocks.back(); - else if (d == direction::reverse) + if (d == direction::reverse) return m_Reverse.back(); return m_EssentialReverse.back(); } @@ -158,7 +158,7 @@ namespace clad { auto* CS = MakeCompoundStmt(getCurrentBlock(direction::forward)); m_Blocks.pop_back(); return CS; - } else if (d == direction::reverse) { + } if (d == direction::reverse) { auto* CS = MakeCompoundStmt(getCurrentBlock(direction::reverse)); std::reverse(CS->body_begin(), CS->body_end()); m_Reverse.pop_back(); diff --git a/include/clad/Differentiator/TBRAnalyzer.h b/include/clad/Differentiator/TBRAnalyzer.h index be8a32449..69743d7e9 100644 --- a/include/clad/Differentiator/TBRAnalyzer.h +++ b/include/clad/Differentiator/TBRAnalyzer.h @@ -63,6 +63,9 @@ class TBRAnalyzer : public clang::RecursiveASTVisitor { std::unique_ptr m_ArrData; Expr* m_RefData; VarDataValue() : m_ArrData(nullptr) {} + /// `= default` cannot be used here since + /// default destructor is implicitly deleted. + // NOLINTNEXTLINE(modernize-use-equals-default) ~VarDataValue() {} }; VarDataType type = UNDEFINED; @@ -160,6 +163,7 @@ class TBRAnalyzer : public clang::RecursiveASTVisitor { VarsData() = default; VarsData(const VarsData& other) = default; + ~VarsData() = default; VarsData(VarsData&& other) noexcept : data(std::move(other.data)), prev(other.prev) {} VarsData& operator=(const VarsData& other) = delete; VarsData& operator=(VarsData&& other) noexcept {