Add support for inserting ArrayRef<FixItHint> into DiagnosticBuilder.
This is going to be needed in clang-tidy as more checks add complex fixits. llvm-svn: 230495
This commit is contained in:
@@ -3152,10 +3152,7 @@ void CheckFormatHandler::EmitFormatDiagnostic(Sema &S, bool InFunctionCall,
|
||||
if (InFunctionCall) {
|
||||
const Sema::SemaDiagnosticBuilder &D = S.Diag(Loc, PDiag);
|
||||
D << StringRange;
|
||||
for (ArrayRef<FixItHint>::iterator I = FixIt.begin(), E = FixIt.end();
|
||||
I != E; ++I) {
|
||||
D << *I;
|
||||
}
|
||||
D << FixIt;
|
||||
} else {
|
||||
S.Diag(IsStringLocation ? ArgumentExpr->getExprLoc() : Loc, PDiag)
|
||||
<< ArgumentExpr->getSourceRange();
|
||||
@@ -3165,10 +3162,7 @@ void CheckFormatHandler::EmitFormatDiagnostic(Sema &S, bool InFunctionCall,
|
||||
diag::note_format_string_defined);
|
||||
|
||||
Note << StringRange;
|
||||
for (ArrayRef<FixItHint>::iterator I = FixIt.begin(), E = FixIt.end();
|
||||
I != E; ++I) {
|
||||
Note << *I;
|
||||
}
|
||||
Note << FixIt;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user