Fix two bugs that fell out from a testcase steve noticed. for this testcase:

extern int pintFunc(int *, int *);

int test() {
  pintFunc(0,
           3);
}

We now print:

t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast
  pintFunc(0,
  ~~~~~~~~  ^

instead of:

t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast
  pintFunc(0,
  ~~~~~~~~

llvm-svn: 39516
This commit is contained in:
Chris Lattner 2007-05-29 05:53:15 +00:00
parent 86272ea1fe
commit e64a1b5275
1 changed files with 2 additions and 2 deletions

View File

@ -546,10 +546,10 @@ void DiagnosticPrinterSTDERR::HandleDiagnostic(Diagnostic::Level Level,
HighlightRange(Ranges[i], LineNo, CaratLine, SourceLine);
// Next, insert the carat itself.
if (ColNo < CaratLine.size())
if (ColNo-1 < CaratLine.size())
CaratLine[ColNo-1] = '^';
else
CaratLine.push_back(ColNo);
CaratLine.push_back('^');
// Scan the source line, looking for tabs. If we find any, manually expand
// them to 8 characters and update the CaratLine to match.