unsigned PrintFromType : 1;
unsigned ElideType : 1;
unsigned ShowColors : 1;
+ // The printer sets this variable to true if the template diff was used.
+ unsigned TemplateDiffUsed : 1;
};
/// Special character that the diagnostic printer will use to toggle the bold
switch (Kind) {
default: llvm_unreachable("unknown ArgumentKind");
case DiagnosticsEngine::ak_qualtype_pair: {
- const TemplateDiffTypes &TDT = *reinterpret_cast<TemplateDiffTypes*>(Val);
+ TemplateDiffTypes &TDT = *reinterpret_cast<TemplateDiffTypes*>(Val);
QualType FromType =
QualType::getFromOpaquePtr(reinterpret_cast<void*>(TDT.FromType));
QualType ToType =
TDT.PrintFromType, TDT.ElideType,
TDT.ShowColors, S)) {
NeedQuotes = !TDT.PrintTree;
+ TDT.TemplateDiffUsed = true;
break;
}
TDT.ToType = getRawArg(ArgNo2);
TDT.ElideType = getDiags()->ElideType;
TDT.ShowColors = getDiags()->ShowColors;
+ TDT.TemplateDiffUsed = false;
intptr_t val = reinterpret_cast<intptr_t>(&TDT);
const char *ArgumentEnd = Argument + ArgumentLen;
Argument, ArgumentLen,
FormattedArgs.data(), FormattedArgs.size(),
OutStr, QualTypeVals);
+ if (!TDT.TemplateDiffUsed)
+ FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_qualtype,
+ TDT.FromType));
+
// Append middle text
FormatDiagnostic(FirstDollar + 1, SecondDollar, OutStr);
Argument, ArgumentLen,
FormattedArgs.data(), FormattedArgs.size(),
OutStr, QualTypeVals);
+ if (!TDT.TemplateDiffUsed)
+ FormattedArgs.push_back(std::make_pair(DiagnosticsEngine::ak_qualtype,
+ TDT.ToType));
+
// Append end text
FormatDiagnostic(SecondDollar + 1, Pipe, OutStr);
break;