Skip to content

Commit

Permalink
Fix the -Wunused-parameter build-time warning.
Browse files Browse the repository at this point in the history
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 <i.kononenko@yadro.com>
  • Loading branch information
ikmsk10 committed Jun 26, 2021
1 parent e8e8d43 commit c39e449
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ast/cxx_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c39e449

Please sign in to comment.