mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1483953 - Add a FixIt hint for the ExplicitImplicitChecker analysis. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D4191 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
6ac001b7a4
commit
2238536677
@ -24,10 +24,13 @@ void ExplicitImplicitChecker::check(const MatchFinder::MatchResult &Result) {
|
|||||||
const CXXRecordDecl *Declaration =
|
const CXXRecordDecl *Declaration =
|
||||||
Result.Nodes.getNodeAs<CXXRecordDecl>("class");
|
Result.Nodes.getNodeAs<CXXRecordDecl>("class");
|
||||||
|
|
||||||
|
FixItHint FixItHint =
|
||||||
|
FixItHint::CreateInsertion(Ctor->getLocation(), "explicit ");
|
||||||
diag(Ctor->getLocation(), "bad implicit conversion constructor for %0",
|
diag(Ctor->getLocation(), "bad implicit conversion constructor for %0",
|
||||||
DiagnosticIDs::Error)
|
DiagnosticIDs::Error)
|
||||||
<< Declaration->getDeclName();
|
<< Declaration->getDeclName();
|
||||||
diag(Ctor->getLocation(),
|
diag(Ctor->getLocation(),
|
||||||
"consider adding the explicit keyword to the constructor",
|
"consider adding the explicit keyword to the constructor",
|
||||||
DiagnosticIDs::Note);
|
DiagnosticIDs::Note)
|
||||||
|
<< FixItHint;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user