From 512cb39ffc646e7126533d782482621a806e825d Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Mon, 3 Feb 2020 14:08:32 +0100 Subject: handle -Wunused-function warnings in clang's sharedvisitor.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5fbf7da1da8c1c5b33e008e30898ca5d2cdfde65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87870 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- compilerplugins/clang/sharedvisitor/generator.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compilerplugins/clang/sharedvisitor/generator.cxx b/compilerplugins/clang/sharedvisitor/generator.cxx index b94083aaa304..62c0798a4801 100644 --- a/compilerplugins/clang/sharedvisitor/generator.cxx +++ b/compilerplugins/clang/sharedvisitor/generator.cxx @@ -296,6 +296,16 @@ void generateVisitor( PluginType type ) output << " --activeRefCount;\n"; output << " " << plugin.variableName << " = save" << plugin.className << ";\n"; } + output << " if( false ) // silence -Wunused-function warnings\n"; + output << " {\n"; + for( const PluginInfo& plugin : plugins[ type ] ) + { + auto pluginTraverse = plugin.traverseFunctions.find( traverse ); + if( pluginTraverse == plugin.traverseFunctions.end()) + continue; + output << " " << plugin.variableName << "->" << pluginTraverse->name << "( arg );\n"; + } + output << " }\n"; output << " return ret;\n"; output << " }\n"; } -- cgit