diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-11-25 10:16:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-11-25 14:06:35 +0100 |
commit | e4c841f7999538522e9453dde9a2d021df5cf149 (patch) | |
tree | e50f7bc5656f077367f2614b427a1157841b413e /compilerplugins | |
parent | da212b3e090d1832388834b135c8f358747f4b96 (diff) |
Ignore unparsed function template bodies in loplugin:stringviewparam
Otherwise, clang-cl would have reported a false positive at
> In file included from C:/lo-clang/core/canvas/source/directx/dx_bitmapcanvashelper.cxx:36:
> C:/lo-clang/core/include\canvas/canvastools.hxx(501,42): error: replace function parameter of type 'const rtl::OUString &' with 'std::u16string_view' [loplugin:stringviewparam]
> bool lookup( const OUString& rName,
> ~~~~~~~~~~~~~~~~^~~~~
Change-Id: Iee71ad721ebe891f51ad1dd6eba50162e40fd998
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106574
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/stringviewparam.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compilerplugins/clang/stringviewparam.cxx b/compilerplugins/clang/stringviewparam.cxx index c359c1a9dc82..3056b6412930 100644 --- a/compilerplugins/clang/stringviewparam.cxx +++ b/compilerplugins/clang/stringviewparam.cxx @@ -454,6 +454,10 @@ private: { return false; } + if (decl->getBody() == nullptr) // unparsed template + { + return false; + } if (auto const d = dyn_cast<CXXMethodDecl>(decl)) { if (d->isVirtual()) |