Avoid --disable-assert-always-abort loplugin:stringviewparam false positives

...like

> l10ntools/source/helper.cxx:19:69: error: replace function parameter of type 'const rtl::OString &' with 'std::string_view' [loplugin:stringviewparam]
>     const OString& rText, const OString& rUnEscaped, const OString& rEscaped )
>                                                      ~~~~~~~~~~~~~~~^~~~~~~~

where the call to rEscaped.getLength(), which would otherwise suppress the
warning, is hidden inside an assert.

(Similar to aab0322580 "Disable
loplugin:casttovoid when --disable-assert-always-abort".)

Change-Id: Ie054f75317707757b1c6243c593f539d445a9fee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110331
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2021-02-02 18:29:41 +01:00
parent 947277146e
commit dec14c4a07
2 changed files with 6 additions and 0 deletions

View File

@@ -504,6 +504,10 @@ private:
{
return;
}
if (compiler.getPreprocessor().getIdentifierInfo("NDEBUG")->hasMacroDefinition())
{
return;
}
StringRef fn(handler.getMainFileName());
// leave the string QA tests alone
if (loplugin::hasPathnamePrefix(fn, SRCDIR "/sal/qa/"))

View File

@@ -7,6 +7,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#undef NDEBUG
#include "sal/config.h"
#include <string_view>