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

Improve wording of loplugin:unoany warnings

...which apparently caused confusion occasionally, cf.
<https://gerrit.libreoffice.org/#/c/58687/5> "Unit test for
0853b05b".

Change-Id: I32f1137bcbb86ffa04bc1a6a58fc93ef69cb3022
Reviewed-on: https://gerrit.libreoffice.org/63874
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ea297ab0
......@@ -19,8 +19,8 @@ int main()
css::uno::Any b;
a = b;
a = getAny();
a = css::uno::makeAny(true); // expected-error {{unnecessary copy, rather use <<= operator [loplugin:unoany]}}
a = css::uno::Any(true); // expected-error {{unnecessary copy, rather use <<= operator [loplugin:unoany]}}
a = css::uno::makeAny(true); // expected-error {{unnecessary copy, rather use <<= operator directly with the 'makeAny' argument [loplugin:unoany]}}
a = css::uno::Any(true); // expected-error {{unnecessary copy, rather use <<= operator directly with the 'Any' constructor argument [loplugin:unoany]}}
}
......
......@@ -48,7 +48,8 @@ bool UnoAny::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const * expr)
Namespace("uno").Namespace("star").Namespace("sun").Namespace("com").GlobalNamespace()) {
report(
DiagnosticsEngine::Warning,
"unnecessary copy, rather use <<= operator",
("unnecessary copy, rather use <<= operator directly with the 'makeAny'"
" argument"),
expr->getOperatorLoc())
<< expr->getSourceRange();
return true;
......@@ -59,7 +60,8 @@ bool UnoAny::VisitCXXOperatorCallExpr(CXXOperatorCallExpr const * expr)
//expr->getArg(1)->dump();
report(
DiagnosticsEngine::Warning,
"unnecessary copy, rather use <<= operator",
("unnecessary copy, rather use <<= operator directly with the 'Any' constructor"
" argument"),
expr->getOperatorLoc())
<< expr->getSourceRange();
return true;
......
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