From 47f8eb171ccc47ae0bda8705beb0bb59ccc1a8b3 Mon Sep 17 00:00:00 2001 From: hvellyr Date: Mon, 6 Jun 2016 12:35:08 +0200 Subject: [PATCH] Fix compiler warnings about incomplete override functions The warning on VS2013 was: warning C4266: 'void peg::Ope::Visitor::visit(peg::Whitespace &)' : no override available for virtual member function from base 'peg::Ope::Visitor'; function is hidden I'm surprised that this warning doesn't happen on gcc/clang though. --- peglib.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peglib.h b/peglib.h index 056323f..d7f239c 100644 --- a/peglib.h +++ b/peglib.h @@ -1104,6 +1104,8 @@ struct Ope::Visitor struct AssignIDToDefinition : public Ope::Visitor { + using Ope::Visitor::visit; + void visit(Sequence& ope) override { for (auto op: ope.opes_) { op->accept(*this); @@ -1133,6 +1135,8 @@ struct IsToken : public Ope::Visitor { IsToken() : has_token_boundary(false), has_rule(false) {} + using Ope::Visitor::visit; + void visit(Sequence& ope) override { for (auto op: ope.opes_) { op->accept(*this); @@ -1661,6 +1665,8 @@ private: DetectLeftRecursion(const std::string& name) : s_(nullptr), name_(name), done_(false) {} + using Ope::Visitor::visit; + void visit(Sequence& ope) override { for (auto op: ope.opes_) { op->accept(*this);