From 4e80d22d790492fe8143ca20e956d2f589ce3cbe Mon Sep 17 00:00:00 2001 From: Justin Viiret Date: Wed, 17 Feb 2016 16:54:45 +1100 Subject: [PATCH] Use using directives to silence hiding warning --- src/parser/check_refs.cpp | 4 +++- src/parser/prefilter.cpp | 9 ++++++++- src/parser/unsupported.cpp | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/parser/check_refs.cpp b/src/parser/check_refs.cpp index ad81ae76..fae68f74 100644 --- a/src/parser/check_refs.cpp +++ b/src/parser/check_refs.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Intel Corporation + * Copyright (c) 2015-2016, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -73,6 +73,8 @@ public: throw ParseError(str.str()); } + using DefaultConstComponentVisitor::pre; + void pre(const ComponentBackReference &c) override { if (c.ref_id) { if (c.ref_id >= num_ids) { diff --git a/src/parser/prefilter.cpp b/src/parser/prefilter.cpp index f5a0c66c..ea58a134 100644 --- a/src/parser/prefilter.cpp +++ b/src/parser/prefilter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Intel Corporation + * Copyright (c) 2015-2016, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -80,6 +80,9 @@ public: return numPositions <= MAX_REFERENT_POSITIONS; } + using DefaultConstComponentVisitor::pre; + using DefaultConstComponentVisitor::post; + void pre(const AsciiComponentClass &) override { numPositions++; } @@ -164,6 +167,8 @@ public: explicit FindSequenceVisitor(unsigned ref_id) : id(ref_id) {} explicit FindSequenceVisitor(const std::string &s) : name(s) {} + using DefaultConstComponentVisitor::pre; + void pre(const ComponentSequence &c) override { if (!name.empty()) { if (c.getCaptureName() == name) { @@ -203,6 +208,8 @@ public: PrefilterVisitor(Component *c, const ParseMode &m) : root(c), mode(m) {} ~PrefilterVisitor() override; + using DefaultComponentVisitor::visit; + /** \brief Calls the visitor (recursively) on a new replacement component * we've just created. Takes care of freeing it if the sequence is itself * replaced. */ diff --git a/src/parser/unsupported.cpp b/src/parser/unsupported.cpp index c97a5750..c4b18b6a 100644 --- a/src/parser/unsupported.cpp +++ b/src/parser/unsupported.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Intel Corporation + * Copyright (c) 2015-2016, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -45,6 +45,7 @@ namespace ue2 { class UnsupportedVisitor : public DefaultConstComponentVisitor { public: ~UnsupportedVisitor() override; + using DefaultConstComponentVisitor::pre; void pre(const ComponentAssertion &) override { throw ParseError("Zero-width assertions are not supported."); }