From c39e449e179e8fd5ba6951532b37814f726afdea Mon Sep 17 00:00:00 2001 From: Igor Kononenko Date: Sat, 26 Jun 2021 18:36:04 +0300 Subject: [PATCH] Fix the `-Wunused-parameter` build-time warning. The methods of the `AstVisitor` base class defines interface only and have no implementation. These should be marked as `[[maybe_unused]]` to prevent propagate the build warnings. Signed-off-by: Igor Kononenko --- ast/cxx_visitor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ast/cxx_visitor.py b/ast/cxx_visitor.py index f1b7029..2e9b5ee 100644 --- a/ast/cxx_visitor.py +++ b/ast/cxx_visitor.py @@ -38,11 +38,11 @@ def end_file(self): def start_type(self, name): titleName = title(name) camelName = camel(titleName) - print ' virtual bool visit%s(const %s &%s) { return true; }' % ( + print ' virtual bool visit%s([[maybe_unused]] const %s &%s) { return true; }' % ( titleName, titleName, camelName) - print ' virtual void endVisit%s(const %s &%s) { }' % ( + print ' virtual void endVisit%s([[maybe_unused]] const %s &%s) { }' % ( titleName, titleName, camelName)