mirror of
https://github.com/LibreOffice/core.git
synced 2025-07-29 21:00:46 +00:00
loplugin:simplifyconstruct improve warning message
which was needlessly cryptic Change-Id: Ifb91631705accff3f49ec3f55b67e83532d70a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182199 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@ -96,7 +96,8 @@ bool SimplifyConstruct::VisitVarDecl(VarDecl const* varDecl)
|
||||
if (compiler.getSourceManager().isMacroBodyExpansion(init->getBeginLoc()))
|
||||
return true;
|
||||
|
||||
report(DiagnosticsEngine::Warning, "simplify", varDecl->getLocation())
|
||||
report(DiagnosticsEngine::Warning, "simplify construction, just use 'Foo a(...);'",
|
||||
varDecl->getLocation())
|
||||
<< varDecl->getSourceRange();
|
||||
|
||||
return true;
|
||||
|
@ -60,7 +60,7 @@ struct Foo
|
||||
};
|
||||
void f(Foo* f)
|
||||
{
|
||||
// expected-error@+1 {{simplify [loplugin:simplifyconstruct]}}
|
||||
// expected-error@+1 {{simplify construction, just use 'Foo a(...);' [loplugin:simplifyconstruct]}}
|
||||
rtl::Reference<Foo> x = rtl::Reference(f);
|
||||
}
|
||||
}
|
||||
@ -80,7 +80,7 @@ namespace test5
|
||||
{
|
||||
void f()
|
||||
{
|
||||
// expected-error@+1 {{simplify [loplugin:simplifyconstruct]}}
|
||||
// expected-error@+1 {{simplify construction, just use 'Foo a(...);' [loplugin:simplifyconstruct]}}
|
||||
tools::Rectangle x = tools::Rectangle(10, 10, 10, 10);
|
||||
(void)x;
|
||||
}
|
||||
|
Reference in New Issue
Block a user