From 85bb04786af7cc8d8fa5734dfd5b66ce3ead5a7b Mon Sep 17 00:00:00 2001 From: Krishna Padmasola Date: Tue, 28 Nov 2023 19:48:44 +0530 Subject: [PATCH] Fix for compilation warnings (#2446) --- src/ast/analysis/PrecedenceGraph.h | 2 +- src/ast/analysis/SCCGraph.h | 2 +- src/tests/visitor_test.cpp | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ast/analysis/PrecedenceGraph.h b/src/ast/analysis/PrecedenceGraph.h index 12e036e6815..3c86dbde943 100644 --- a/src/ast/analysis/PrecedenceGraph.h +++ b/src/ast/analysis/PrecedenceGraph.h @@ -44,7 +44,7 @@ class PrecedenceGraphAnalysis : public Analysis { void print(std::ostream& os) const override; /** Output precedence graph in image format to a given stream */ - void printHTML(std::ostream& os) const; + void printHTML(std::ostream& os) const override; const Graph& graph() const { return backingGraph; diff --git a/src/ast/analysis/SCCGraph.h b/src/ast/analysis/SCCGraph.h index b30e6d4e2d9..fa165d9792e 100644 --- a/src/ast/analysis/SCCGraph.h +++ b/src/ast/analysis/SCCGraph.h @@ -205,7 +205,7 @@ class SCCGraphAnalysis : public Analysis { void print(std::ostream& os) const override; /** Print the SCC graph in HTML format. */ - void printHTML(std::ostream& os) const; + void printHTML(std::ostream& os) const override; private: PrecedenceGraphAnalysis* precedenceGraph = nullptr; diff --git a/src/tests/visitor_test.cpp b/src/tests/visitor_test.cpp index 86ab678c481..977c454088e 100644 --- a/src/tests/visitor_test.cpp +++ b/src/tests/visitor_test.cpp @@ -44,7 +44,7 @@ namespace { template auto asVec(XS&&... xs) { vector v; - (v.push_back(forward(xs)), ...); + (v.push_back(std::forward(xs)), ...); return v; } @@ -54,7 +54,7 @@ struct Node { VecOwn kids; template - Node(A&&... xs) : kids(asVec>(forward(xs)...)) {} + Node(A&&... xs) : kids(asVec>(std::forward(xs)...)) {} virtual vector getChildNodes() const { return toPtrVector(kids); @@ -151,7 +151,7 @@ template void TEST_INSTANTIATION_MAPPER() { A x; mapPost(x, [&](Own x) { return x; }); - mapFrontier(x, [&](Own x) { return pair{move(x), false}; }); + mapFrontier(x, [&](Own x) { return pair{std::move(x), false}; }); } // Check that visitor function instantiates successfully. @@ -209,7 +209,7 @@ TEST(NodeMapper, mapPrePost_BarToFoo) { auto go = [](Own n) { auto x = mk(); - x->kids = move(n->kids); + x->kids = std::move(n->kids); return x; }; EXPECT_EQ(*expected, *mapPre(mkTree(), go)); @@ -229,8 +229,8 @@ TEST(NodeMapper, mapFrontier_FooToBar) { auto go = [](Own n) { auto x = mk(); - x->kids = move(n->kids); - return pair{move(x), true}; + x->kids = std::move(n->kids); + return pair{std::move(x), true}; }; auto&& [produced, n] = mapFrontier(mkTree(), go);