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 =
|
||||
Result.Nodes.getNodeAs<CXXRecordDecl>("class");
|
||||
|
||||
FixItHint FixItHint =
|
||||
FixItHint::CreateInsertion(Ctor->getLocation(), "explicit ");
|
||||
diag(Ctor->getLocation(), "bad implicit conversion constructor for %0",
|
||||
DiagnosticIDs::Error)
|
||||
<< Declaration->getDeclName();
|
||||
diag(Ctor->getLocation(),
|
||||
"consider adding the explicit keyword to the constructor",
|
||||
DiagnosticIDs::Note);
|
||||
DiagnosticIDs::Note)
|
||||
<< FixItHint;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user