Skip to content

Commit bd0e43e

Browse files
committed
Fix #285 (Warnings due to -Woverloaded-virtual)
1 parent 6c1089b commit bd0e43e

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

peglib.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,8 @@ struct Ope::Visitor {
16881688
};
16891689

16901690
struct TraceOpeName : public Ope::Visitor {
1691+
using Ope::Visitor::visit;
1692+
16911693
void visit(Sequence &) override { name_ = "Sequence"; }
16921694
void visit(PrioritizedChoice &) override { name_ = "PrioritizedChoice"; }
16931695
void visit(Repetition &) override { name_ = "Repetition"; }
@@ -1723,6 +1725,8 @@ struct TraceOpeName : public Ope::Visitor {
17231725
};
17241726

17251727
struct AssignIDToDefinition : public Ope::Visitor {
1728+
using Ope::Visitor::visit;
1729+
17261730
void visit(Sequence &ope) override {
17271731
for (auto op : ope.opes_) {
17281732
op->accept(*this);
@@ -1751,6 +1755,8 @@ struct AssignIDToDefinition : public Ope::Visitor {
17511755
};
17521756

17531757
struct IsLiteralToken : public Ope::Visitor {
1758+
using Ope::Visitor::visit;
1759+
17541760
void visit(PrioritizedChoice &ope) override {
17551761
for (auto op : ope.opes_) {
17561762
if (!IsLiteralToken::check(*op)) { return; }
@@ -1772,6 +1778,8 @@ struct IsLiteralToken : public Ope::Visitor {
17721778
};
17731779

17741780
struct TokenChecker : public Ope::Visitor {
1781+
using Ope::Visitor::visit;
1782+
17751783
void visit(Sequence &ope) override {
17761784
for (auto op : ope.opes_) {
17771785
op->accept(*this);
@@ -1808,6 +1816,8 @@ struct TokenChecker : public Ope::Visitor {
18081816
};
18091817

18101818
struct FindLiteralToken : public Ope::Visitor {
1819+
using Ope::Visitor::visit;
1820+
18111821
void visit(LiteralString &ope) override { token_ = ope.lit_.data(); }
18121822
void visit(TokenBoundary &ope) override { ope.ope_->accept(*this); }
18131823
void visit(Ignore &ope) override { ope.ope_->accept(*this); }
@@ -1825,6 +1835,8 @@ struct FindLiteralToken : public Ope::Visitor {
18251835
};
18261836

18271837
struct DetectLeftRecursion : public Ope::Visitor {
1838+
using Ope::Visitor::visit;
1839+
18281840
DetectLeftRecursion(const std::string &name) : name_(name) {}
18291841

18301842
void visit(Sequence &ope) override {
@@ -1887,6 +1899,8 @@ struct DetectLeftRecursion : public Ope::Visitor {
18871899
};
18881900

18891901
struct HasEmptyElement : public Ope::Visitor {
1902+
using Ope::Visitor::visit;
1903+
18901904
HasEmptyElement(std::vector<std::pair<const char *, std::string>> &refs,
18911905
std::unordered_map<std::string, bool> &has_error_cache)
18921906
: refs_(refs), has_error_cache_(has_error_cache) {}
@@ -1935,6 +1949,8 @@ struct HasEmptyElement : public Ope::Visitor {
19351949
};
19361950

19371951
struct DetectInfiniteLoop : public Ope::Visitor {
1952+
using Ope::Visitor::visit;
1953+
19381954
DetectInfiniteLoop(const char *s, const std::string &name,
19391955
std::vector<std::pair<const char *, std::string>> &refs,
19401956
std::unordered_map<std::string, bool> &has_error_cache)
@@ -1994,6 +2010,8 @@ struct DetectInfiniteLoop : public Ope::Visitor {
19942010
};
19952011

19962012
struct ReferenceChecker : public Ope::Visitor {
2013+
using Ope::Visitor::visit;
2014+
19972015
ReferenceChecker(const Grammar &grammar,
19982016
const std::vector<std::string> &params)
19992017
: grammar_(grammar), params_(params) {}
@@ -2032,6 +2050,8 @@ struct ReferenceChecker : public Ope::Visitor {
20322050
};
20332051

20342052
struct LinkReferences : public Ope::Visitor {
2053+
using Ope::Visitor::visit;
2054+
20352055
LinkReferences(Grammar &grammar, const std::vector<std::string> &params)
20362056
: grammar_(grammar), params_(params) {}
20372057

@@ -2065,6 +2085,8 @@ struct LinkReferences : public Ope::Visitor {
20652085
};
20662086

20672087
struct FindReference : public Ope::Visitor {
2088+
using Ope::Visitor::visit;
2089+
20682090
FindReference(const std::vector<std::shared_ptr<Ope>> &args,
20692091
const std::vector<std::string> &params)
20702092
: args_(args), params_(params) {}

0 commit comments

Comments
 (0)