Kaydet (Commit) cb06f619 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More containsPreprocessingConditionalInclusion checking in loplugin:casttovoid

...to avoid false positive with --disable-dbgutil in SfxApplication ctor
(sfx2/source/appl/app.cxx), which contains

    bool bOk = InitializeDde();
  #ifdef DBG_UTIL
    ...
  #else
    (void)bOk;
  #endif

Change-Id: I4de6322a848a9c6aea3057e4598b2161888dee6a
Reviewed-on: https://gerrit.libreoffice.org/53051Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 25812b3e
......@@ -380,6 +380,11 @@ private:
} else if (!i.second.castToVoid.empty()
&& !isWarnUnusedType(i.first->getType()))
{
auto const fun = dyn_cast_or_null<FunctionDecl>(i.first->getDeclContext());
assert(fun != nullptr);
if (containsPreprocessingConditionalInclusion(fun->getSourceRange())) {
continue;
}
report(
DiagnosticsEngine::Warning,
"unused variable %select{declaration|name}0",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment