Skip to content

Commit

Permalink
Fix Clang-Tidy warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Nov 21, 2023
1 parent fee07c4 commit f11bf1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/clad/Differentiator/ReverseModeVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions include/clad/Differentiator/TBRAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class TBRAnalyzer : public clang::RecursiveASTVisitor<TBRAnalyzer> {
std::unique_ptr<ArrMap> 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;
Expand Down Expand Up @@ -160,6 +163,7 @@ class TBRAnalyzer : public clang::RecursiveASTVisitor<TBRAnalyzer> {

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 {
Expand Down

0 comments on commit f11bf1e

Please sign in to comment.