diff options
Diffstat (limited to 'compilerplugins/clang/unoany.cxx')
-rw-r--r-- | compilerplugins/clang/unoany.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/compilerplugins/clang/unoany.cxx b/compilerplugins/clang/unoany.cxx index 7d10a2361878..38e216fed437 100644 --- a/compilerplugins/clang/unoany.cxx +++ b/compilerplugins/clang/unoany.cxx @@ -7,9 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#ifndef LO_CLANG_SHARED_PLUGINS + #include "check.hxx" #include "plugin.hxx" +namespace { class UnoAny: public loplugin::FilteringPlugin<UnoAny> @@ -17,9 +20,16 @@ class UnoAny: public: explicit UnoAny(loplugin::InstantiationData const & data): FilteringPlugin(data) {} + bool preRun() override { + return compiler.getLangOpts().CPlusPlus; + } + void run() override { - TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + if (preRun()) { + TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); + } } + bool VisitCXXOperatorCallExpr(CXXOperatorCallExpr const * expr); }; @@ -71,7 +81,10 @@ bool UnoAny::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const * expr) return true; } -loplugin::Plugin::Registration<UnoAny> X("unoany"); +loplugin::Plugin::Registration<UnoAny> unoany("unoany"); + +} // namespace +#endif // LO_CLANG_SHARED_PLUGINS /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |