diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-10 20:44:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-10 20:44:00 +0000 |
commit | df667e71b1daadeacb230cf94fc717843f1a138a (patch) | |
tree | 72ebde19e19176d2cc776ce1dab15dc5c6e0d5c3 /lib/Frontend | |
parent | 27b152fa7443f4e24630b997c07def6b0c23925a (diff) |
Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.
In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index 3e6c3ae74b..160b5cfae1 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -278,15 +278,19 @@ void TextDiagnosticPrinter::HandleDiagnostic(Diagnostic::Level Level, OS.write(OutStr.begin(), OutStr.size()); OS << '\n'; - // If caret diagnostics are enabled and we have location, we want to emit the - // caret. However, we only do this if the location moved from the last - // diagnostic, or if the diagnostic has ranges. We don't want to emit the - // same caret multiple times if one loc has multiple diagnostics. + // If caret diagnostics are enabled and we have location, we want to + // emit the caret. However, we only do this if the location moved + // from the last diagnostic, if the last diagnostic was a note that + // was part of a different warning or error diagnostic, or if the + // diagnostic has ranges. We don't want to emit the same caret + // multiple times if one loc has multiple diagnostics. if (CaretDiagnostics && Info.getLocation().isValid() && ((LastLoc != Info.getLocation()) || Info.getNumRanges() || + (LastCaretDiagnosticWasNote && Level != Diagnostic::Note) || Info.getNumCodeModificationHints())) { // Cache the LastLoc, it allows us to omit duplicate source/caret spewage. LastLoc = Info.getLocation(); + LastCaretDiagnosticWasNote = (Level == Diagnostic::Note); // Get the ranges into a local array we can hack on. SourceRange Ranges[20]; |